1827288 Members
3096 Online
109717 Solutions
New Discussion

su another user

 
juno2
Super Advisor

su another user

I want to let a user A to use "su" to login to another user - user B where user A is null password, i tried to modify the file /etc/group and add user A to the wheel statement , but it still can't run su to login as user B , what is wrong in my system ? thx
6 REPLIES 6
Wouter Jagers
Honored Contributor

Re: su another user

If both accounts are set up properly, in other words you can use them separately without problems, it shouldn't be too hard.

Can you switch from userA to root ? (using su -)

The command you use as userA is "su - userB" (without the quotes), right ?

regards
Wouter
an engineer's aim in a discussion is not to persuade, but to clarify.
Stuart Browne
Honored Contributor

Re: su another user

Erm, so 'userA' is issuing 'su - userB', and what's the net result? UserA should be prompted for userB's password.

You shouldn't have to worry about 'groups' at all.

The only limitation could possibly be trying to 'su' to 'root' (as you can limit this to a given group or specific users).

Do you get any error's showing up in the log files?
One long-haired git at your service...
Steven E. Protter
Exalted Contributor

Re: su another user

Please post the command you are using and the resultant output.

Also publish the log output.

/var/log/lastlog should contain useful information.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
juno2
Super Advisor

Re: su another user

Thx all reply,

Another question, the below is one of the statement on the /etc/shadow file ,

# vi /etc/shadow
User_B:!!:12251:0:99999:7:::

what is the meaning of the password field "!!" ? is it null password ? thx

Stuart Browne
Honored Contributor

Re: su another user

No. It's a "No password can match". user cannot log-in.
One long-haired git at your service...
Nat Guyton
Advisor

Re: su another user

You should be able to set an empty password for user B, and anyone can su to that account with no password challenge.

You don't really want to do that, from a security perspective, though.

To allow just user A to su to user B with no password, look at using "sudo" - http://www.sudo.ws/sudo/

If you want user A to run commands as user B and don't want to use sudo, you can use a .rhosts file with rsh (yuck!) or look at ssh with no passphrase in rsa public/private key files...
Never underestimate the bandwidth of a station wagon filled with backup tapes