0

I want to know how i can become root at all times in terminal without having to type in my password or typing sudo. Thanks :D

6
  • 1
    Perhaps sudo -i is what you're looking for. You have to enter your password once, but then until you exit the interactive sudo sesseion, all the commands you run are automatically sudo'ed. – Kallus Jul 6 '13 at 2:51
  • Obviously, if there was an ability to become root without entering your password, that would be a HUGE security risk. – Kallus Jul 6 '13 at 2:52
  • Ah i get you, sorry for not making my question clear... I meant how can i be rooted at all time with only typing my password once and even if i exit out of terminal i will still be rooted when i go back. Thanks for your help though :D – Jester Jul 6 '13 at 2:56
  • You should not be root all the time. If you think you should, you're doing it wrong. I have a previous answer on sudo that entails making it no-prompt, but I note that it's a bad idea i think... askubuntu.com/questions/118204/… – RobotHumans Jul 6 '13 at 3:40
  • It's alright, i'm not worried about security threats, it's only for my netbook and it's really slow so i would want it rooted at all times – Jester Jul 6 '13 at 4:12
-1

i've looked, as i wanted to do this so i could move files from /host to the desktop, and from what i've seen, there is no way, because of the security of it.

0
1

You can log in directly as root instead of a user. If you're logging into a graphical desktop, this is very bad security practice, since you'll end up running a huge amount of software as root that doesn't typically need to be run as root, and isn't designed to be; a massive attack surface. Logging into an ssh session or text console as root is much less of an issue, but still potentially bad for security auditing reasons.

In Ubuntu, the root user by default has no password, so you can't log in as root[1]. To change this, you can run "passwd root" as root (e.g. using sudo). Make sure you pick an extremely complex password; enabling password-based login as root reduces your system's security, and using a weak password will reduce it significantly more.

Since you really don't want to reduce the security of your system this way, use sudo as described in the other answer, or my favorite sudo bash.

[1] except over ssh using an SSH key for example...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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