LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   Changing user in bash script. (https://www.linuxquestions.org/questions/linux-security-4/changing-user-in-bash-script-425091/)

r3gan 03-15-2006 10:38 AM

Changing user in bash script.
 
Hi,

I'm new to bash scripting, and I have a problem with running the 'su' command. When I try to 'su' in my script, I get prompted for the user's password. Is there any way to echo a password from my script to the waiting prompt??

alunduil 03-15-2006 11:04 AM

man su, and you'll find your answer.

Regards,

Alunduil

r3gan 03-15-2006 11:16 AM

alunduil,
I have already checked the man pages for 'su'. From what I can see, there is no -p option or anything to submit a password as an arguement to the 'su' command.

nx5000 03-15-2006 11:27 AM

If you can, there is a tool for this:
sudo

for su maybe with expect language but sudo is really for this.


All times are GMT -5. The time now is 10:35 PM.