Home Man
Search
Today's Posts
Register

BSD, Linux, and UNIX shell scripting — Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.

Shell commands and ps and server logs

Tags
shell scripts

Login to Reply

 
Thread Tools Search this Thread
# 1  
Old 04-13-2018
Shell commands and ps and server logs

Good afternoon all!! I am writing a shell script that will generate a random phrase to be used as a password.

this is the line I use to generate the password
Code:
echo `head -n 10 /dev/urandom | tr -cd "[:alnum:]*+,-/:;<=>?_" | cut -c '1-'$3`

The third input in the command is the length of the password i want to use.

What I do next is login to a Oracle DB and change a user accounts password using what was generated. I would prefer that password nor its generation of it be discover via ps or anything like that. My question is what gets captured by the server in the /proc/PID/ folders or any server logs? Is there a way to work around any of that being captured? Thanks.


Moderator's Comments:
Shell commands and ps and server logs Please use CODE tags as required by forum rules!

Last edited by RudiC; 04-13-2018 at 05:05 PM.. Reason: Added CODE tags.
# 2  
Old 04-14-2018
I'm not sure I understand your request correctly, and even less I know about what Oracle permits and provides in terms of password input.
You might supply the generated password on stdin via a pipe, or using a temp file, or a FIFO. Unfortunately, I'm not able to test any of these proposals.
# 3  
Old 04-15-2018
How about this:

Code:
LEN=${3:-8}
NEW_PASS=$(/usr/bin/openssl rand -base64 $LEN)

# 4  
Old 04-23-2018
sorry for not making that clearer. What I am trying to achieve is a script that doesn't have the info it generates it either ps or in a server log file. Can that be achieved by a pipe or is there a better way?
# 5  
Old 04-23-2018
What shows in ps is commandline arguments.

What do you do right now?
# 6  
Old 04-23-2018
Who are you trying to hide the information from? If the user(s) has root access than there is very little that can be done.

If they don't have root access then the auditing logs shouldn't be readable, and unless they have the same userid that ran the password change script, they will not be able to look in the /proc/<pid> files either.

Is the oracle DB hosted on the same server? Are you using the ALTER USER command to change the password or something else? How are you getting this command to Oracle?
# 7  
Old 05-22-2018
The oracle DB is hosted on the same server and yes i am using alter user. What i am really trying to determine is if i create a password on the fly inside of a script and assign it to a variable and then sqlplus in via oracle wallet will they variable that holds the password be viewable by someone snooping on the server? I would assume if they were good enough and got ahold of either the oracle account or the root account on the server then yes they would. Would those be the only two?
Login to Reply

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Shell script file movement to a Mail Box server using ftp commands developer.dwh9 Open Source 2 03-05-2015 09:24 AM
How to keep server out of logs? postcd UNIX for Dummies Questions & Answers 2 04-01-2014 12:56 PM
Comprehensive Disk & Server Logs. vaibhavvsk Red Hat 1 03-06-2014 02:53 PM
Shell Script for viewing multiple logs from multiple server peeyush Shell Programming and Scripting 1 10-23-2013 05:05 PM
Program: How to FTP logs from a Server to Desktop rymnd_12345 UNIX for Dummies Questions & Answers 2 12-09-2011 12:10 PM
logs of commands performed by users prpkrk UNIX for Dummies Questions & Answers 1 10-14-2011 06:31 AM
Login and logout logs in server kancherla.sree Solaris 10 07-07-2011 06:29 AM
Sending all apache logs to Syslog Server sidhurana Red Hat 3 01-18-2010 05:13 AM
Can BASH execute commands on a remote server when the commands are embedded in shell bash_in_my_head Shell Programming and Scripting 1 12-04-2008 12:51 AM
Shell script to view logs of a server abhishek27 Shell Programming and Scripting 1 06-24-2008 06:06 AM


All times are GMT -4. The time now is 06:56 PM.

Unix & Linux Forums Content Copyright©1993-2018. All Rights Reserved.
UNIX.COM Login
Username:
Password:  
Show Password