Operating System - HP-UX
1829564 Members
1261 Online
109992 Solutions
New Discussion

su user in local host w/o password

 
SOLVED
Go to solution
hangyu
Regular Advisor

su user in local host w/o password

There are two user ( userA and userB ) in the same host , I want to let userA can su to userB without input the password , I tried to change ~userB/.rhosts , add "127.0.0.1 userA" to it , but still can't , can advise what can i do ? thx
4 REPLIES 4
RAC_1
Honored Contributor

Re: su user in local host w/o password

You can't do that with su. You can use sudo or just do an remsh (after setting .rhosts) on same host.
There is no substitute to HARDWORK
Patrick Wallek
Honored Contributor

Re: su user in local host w/o password

Using su as a normal, ie non-root, user will ALWAYS require a password. You can use a utility like sudo to get around this.

http://www.gratisoft.us/sudo/

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

Re: su user in local host w/o password

thx reply,

except sudo , can use "ssh" to login local user ? thx
Mel Burslan
Honored Contributor
Solution

Re: su user in local host w/o password

Yes, you can use ssh for the purpose you need.

while logged in as userA

ssh userB@localhost

gets you to userB's shell, if you have the matching public/private key pair in the right places. (public key should be on one line in the file ~userB/.ssh/authorized_keys and the private key should be ~userA/.ssh/id_dsa)

We us this method to enable our SAP sidadm accounts access orasid accounts at the time of application startup and shutdown. It is especially useful if you keep the same key pair on the multiple servers hosting an SAP instance, so that they can do their transports and what have you, necessary for their operations without us, the sysadmins getting involved all the time.

Hope this helps
________________________________
UNIX because I majored in cryptology...