Operating System - HP-UX
1756506 Members
2575 Online
108848 Solutions
New Discussion юеВ

su -m <user> passwordless?

 
SOLVED
Go to solution
Allanm
Super Advisor

su -m <user> passwordless?

Hi!

I have a script which prompts for password for a non-root user, can I avoid that?

su -m
Prompts for a password.

Its a startup script and the start up fails?

How can I fix this?

Thanks.
2 REPLIES 2
James R. Ferguson
Acclaimed Contributor
Solution

Re: su -m <user> passwordless?

Hi:

Startup scripts are run as the 'root' user and thus you can launch *your* script from within the startup wrapper with:

su - someuser -c '/usr/local/bin/someuser.sh'

If a non-root process attempts to do a 'su' an interactive password prompt will be offered. You can't defeat this with redirection. In that case, your best recourse is probably to use 'expect':

http://en.wikipedia.org/wiki/Expect

Regards!

...JRF...
Allanm
Super Advisor

Re: su -m <user> passwordless?

Thanks!