Operating System - HP-UX
1832568 Members
4662 Online
110043 Solutions
New Discussion

If I want to login automatic (no prompt to enter password) after su command, How to do?

 
akit3210
Occasional Advisor

If I want to login automatic (no prompt to enter password) after su command, How to do?

I set .profile of user "xxx" to
------------------
./menu.sh
exit
------------------
After I login to user "xxx", It's will call menu.sh script.
If I want to change user to "yyy" before call menu.sh
How I can do? (by no prompt for enter password). I try to user su command

su - yyy
./menu.sh
exit

It's will ask password (Sure, I know password of user yyy). But I don't want user
"xxx" enter password, How to automatic login user "yyy"?

Thank you.
2 REPLIES 2
Patrick Wallek
Honored Contributor

Re: If I want to login automatic (no prompt to enter password) after su command, How to do?

If user xxx is NOT a root user, then the only is to use a package like sudo.

You would set up sudo to allow user xxx to do a 'su - yyy'. Then in the menu you would do:

sudo su - yyy
./menu.sh
exit

You can get sudo from:

http://www.courtesan.com/sudo

and/or

http://hpux.connect.org.uk/hppd/hpux/Sysadmin/sudo-1.6.8p9/

Yogeeraj_1
Honored Contributor

Re: If I want to login automatic (no prompt to enter password) after su command, How to do?

hi,

ssh would be another option to consider.

hope this helps too!

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)