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 want to be able to execute root commands without needing to type sudo, but I don't want to change user so that I can still for example be able to do "cd ~" to go to where I have been doing work and have aliases.

How can I do this?

share|improve this question
    
You are lessing the protection provided by sudo by doing this. Why not just login as root and source the appropriate startup files if you want to do what you are suggesting? –  mdpc Nov 15 '12 at 20:17
    
Why are you doing this? It may be your approach that is wrong. –  gparent Nov 15 '12 at 20:55
    
I'm doing this because I installed Fedora and it made me my own user instead of root which is fine but I'm the only one using it and I don't like the inconvenience of needing to type sudo sometimes. It doesn't provide much protection if all I need to do is type sudo and it does provide a lot of inconvenience. –  Edwin Evans Nov 17 '12 at 3:39
add comment

1 Answer 1

Sounds like you want a "sudo su" shell. You run "su" through sudo, then your euid is 0 but you still have the environment from your non-root ID. Although honestly, you probably want to re-think why you're having to run root commands when doing what I assume is non-root work in the first place...

share|improve this answer
    
Or just plain su should work. –  Sammitch Nov 15 '12 at 22:25
    
True, but in Ubuntu there is no root password, you have to sudo to set one, so "sudo su" will work more universally than just "su". –  John Nov 16 '12 at 14:05
    
But I still want to be logged in as my own self so I can use ~ for my home directory. I installed Fedora and I'm the only one using it. What do you suggest if I don't want to have to type sudo? (It also makes aliases with parameters more tricky.) –  Edwin Evans Nov 17 '12 at 3:31
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.