Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I wish for a user to have root privileges, but editing the /etc/sudoers file to allow no password still requires me to use the sudo command before a program I wish to run with elevated privileges .

I do I effectively make a normal user root without being root so I have a structured home folder?

share|improve this question
    
Why not have the user SU to root instead of using sudo? –  SpacemanSpiff Dec 27 '10 at 3:22
    
@Tom, will not all files I save be written under root (root's ownership) then and not the current user? –  Robert Renu. Dec 27 '10 at 3:26
5  
The real answer here is don't do that. –  mattdm Dec 27 '10 at 5:45
add comment

2 Answers

up vote 2 down vote accepted

In general, this is a bad idea, however if you really require this, then modify the following in /etc/sudoers:

## Allow root to run any commands anywhere
root    ALL=(ALL)       ALL
<username>    ALL=(ALL)       ALL

## Same thing without a password
# %wheel        ALL=(ALL)       NOPASSWD: ALL
<username>      ALL=(ALL)       NOPASSWD: ALL

Or you can just use vipw and set the uid to be 0 for that username.

share|improve this answer
add comment

If you do:

sudo su -

you will run 'su' with root permissions (elevated via sudo) and the trailing - means that you will use root's environmental variables, not your own.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.