[sudo-users] Unable to change user in script
Steffen.A.Johnson at wellsfargo.com
Steffen.A.Johnson at wellsfargo.com
Wed Aug 4 17:07:36 EDT 2004
I wrote the following ksh script to automatically change the user ID.
#!/usr/bin/ksh
PASSWD=test1
sudo -S su - otheruser << EOF
echo $PASSWD
EOF
When I run the script the passwd is passed to the su command properly but I
get the following
error message every time I run the program
Password:
Sorry, try again.
Password:
sudo: 1 incorrect password attempt
I've checked that I am user "test1_user" and my passwd is test1.
Does anyone have any clues of why my script is failing?
TIA
Steffen
More information about the sudo-users
mailing list