Page 1 of 1

Switch User Command in unix

Posted: Fri Oct 14, 2005 12:57 am
by arati
Is there any way to switch the user login between the current session? We are using 'su' command but it is asking for the password.This we want to implement in script so there any way to pass password as an argument or any other command?Please help us.Thank you.

Posted: Fri Oct 14, 2005 1:01 am
by WoMaWil
Could you please explain, what you are going to do? Sometimes there are other solutions that fit better to the problem than that what you think.

Wolfgang

Posted: Fri Oct 14, 2005 2:05 am
by arati
We are using our development id to run some scripts but for some file transfer we required to login with other user id. Currently we use su , but the issue we face is it asks for password. So, we are unable to perform this operation through script. Do you have any ideas/suggestions ?

Posted: Fri Oct 14, 2005 3:37 am
by Eric
Use a shell script to run the file FTP and pass the required username and password as part of the ftp script. (read up on FTP options)

Posted: Fri Oct 14, 2005 6:39 am
by kcbland
Use indirection to put the password into the input stack.