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

Sudo help

Status
Not open for further replies.

mdraja

Programmer
Oct 14, 2003
44
GB
Hi

How do u use sudo to su to root without having to provide a password.
My username is userA who is in group system

My sudoers file is as follows:


root ALL=(ALL) ALL
userA ALL=(ALL) ALL

When I type:

/usr/local/bin/sudo su - root

I still get prompted for a password and I would like to go straight in

Any help greatly appreciated
 
AFAIK you don't :)

sudo allows users to run any command that is configured for them - even those normally run by root.

It is not a method of su'ing to root without a password

Alex
 
And the password it is asking you for is not root's, it is your ordinary user name.

Also, if you do a sudo su - root, you are totally defeating one of the best parts about sudo: logging what commands are being executed and from where they are executed. You would be better off if you do something like:

sudo 1stcommand

then

sudo 2ndcommand

If you sudo 2ndcommand within about 5 minutes of the first use of sudo, you will not be prompted for the password again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top