-3

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?

Edwin Evans
  • 123
  • 4
  • 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 03:39

1 Answers1

4

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...

John
  • 9,070
  • 1
  • 29
  • 34
  • 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 03:31