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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

su a user without giving the passwd

Status
Not open for further replies.

Barn

Technical User
Feb 22, 2002
37
FR

Hi!

How a none root user can su an other none root user without needing to give the password?

Note that I don't want to use the rsh command, .rhosts file...

Thanks in advance.
 

Use sudo?? Then 'sudo su user'.
You need to download sudo somewhere on the net.

Cheers Henrik Morsing
Certified AIX 4.3 Systems Administration
& p690 Technical Support
 
I 've got sudo from
sudo-1.6.6.0 (May 3 2002 )

How do I use it now? The only help I have from the commande is:
#sudo -h
usage: sudo -V | -h | -L | -l | -v | -k | -K | [-H] [-P] [-S] [-b] [-p prompt]
[-u username/#uid] -s | <command>

Thank you.
 

Create an /etc/sudoers file containing:

username ALL=(ALL) NOPASSWD: ALL

This means that that user can do 'sudo su -' without giving a password at all.
The file should have permissions set to 660.

Cheers Henrik Morsing
Certified AIX 4.3 Systems Administration
& p690 Technical Support
 
Or, just modify the /etc/passwd so the user and group ID of the two users matches.

IE
maint:!:200:200::/home/maint
user1:!:300:300::/home/user1

becomes

maint:!:200:200::/home/maint
user1:!:200:200::/home/user1
 
You could just write a simple c program which performs a su to the appropriate user and have this program suid ed to root

Dave
 
umm, if you give sudo all, then you can run anything as root. better to just give the user a commad like

USERA ALL = su - USERB

this will allow usera to only run su - USERB and not other stuff like sudo rm -R *

here is the web doc on the suders file
Before you criticize someone, you should walk a mile in their shoes. That way you're a mile away and you have their shoes.
 
Better try [tt]visudo[/tt] to edit your [tt]/etc/sudoers[/tt] file (simply give the command not the file), it will validate your syntax.

Read your sudo man page, it will teach you what to do to give the user only some commands, only commands with options, commands when is logged from some machines, et cetera.


I hope it works...
Unix was made by and for smart people.
 
Thanks guys!

Barn.
IBM Certified -- Am I?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top