Dear all,

I'm doing a script to create a DB user on all machines. I have no way of using sudo. This is for a cross section of sun machines.
i need to ssh to the server, then do a su to root, create the account and then exit. i have done the following:
## Script to create the mondba account ##
## Date 22Aug2007 ##
export PATH
ssh -p 15560 user1@jupiter << EOW
su - root 2>&1
useradd -m -d /export/home/mondba -u 33332 mondba
passwd mondba

Now the problem, I will be prompted for the user1 password but not the root password which i'm supposed to get as a result of the su - i'm executing. Instead i get su: Sorry, looks like it gets timed out. Please give me a hint.
Thanks in advance!

Try this:

Put your script in a file,, e.g. As the last (or second last) line of the script, put in "rm -f /tmp/" to make the script delete itself. Then:

scp -p 15560 user1@jupiter:/tmp
ssh -t -p 15560 user1@jupiter su root -c "\"sh -x /tmp/addmondba\""

If this doesn't work directly, it should get you closer.