Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

su help

Status
Not open for further replies.

zsfhaergta

Programmer
Oct 6, 2008
26
US
Hi,

I know it is possible to set up sudo so a user enters his own password for root access. Is it possible to set up su to do the same?

Something like this

user$ su 'someotheruser'
Password: 'user's password'

NOT:
Password: 'someotheruser's password'

Thanks
 
Not that I know of. But you should check the man page on this. However, you can do
Code:
sudo su
and have the same effect.

+++ Despite being wrong in every important aspect, that is a very good analogy +++
Hex (in Darwin's Watch)
 
I agree with DonQuichote that it isn't possible with su.

The only exception is when you are already running as a super user (root). In that case su would not prompt you for a password when you change UIDs.

The only way around this (which is probably not what you want) is to set up sudo so that certain users can su to root; after that point they can su <username> to a different user without a password.
 
1. The user needs to be an administrator, or

2. If all users have the same password, they can do that. ;-)
 
I don't know what you try to achieve, but if you just want a shell as another user (even as a user who does not have a shell, such as a web server user), you can do:

Code:
sudo -u [i]someotheruser[/i] bash

I did this trick to set up SSH keys and test connections for the web server user.

+++ Despite being wrong in every important aspect, that is a very good analogy +++
Hex (in Darwin's Watch)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top