shell script switching user question
Hello. I'm in need of a shell script that can switch users. However, I can't seem to get it to work. It will execute the su command but it keeps prompting me for a password. How do I pass this in? I'm writing this in php, so here's what i've tried so far:
exec("su userid -c pass");
exec("su -c user id pass");
exec("su -c user id 'pass'");
If someone could let me know what i'm doing wrong or point to a site that show me it would be greatly appreciated! Thanks in advance!