root login

Asked by Todd Reichert

I want to actually login as root on my Ubuntu 10.10 system. Is there any way to accomplish this?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu sudo Edit question
Assignee:
No assignee Edit question
Solved by:
Eliah Kagan
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

Its not supported or advise or necessary.Doing so is a MASSIVE security risk. This shows some reasons and I believe how but you will have to hack your system a LOT

I STRONGLY advise you stick to using sudo so you
a) Don't kill your system due to human error
b) Don't start running email apps and web browsers (stupidly) as root

https://help.ubuntu.com/community/RootSudo

If you need an interactive sudo, you can use:

sudo -i

and you will not be bothered for a password til you run:

exit

This effectively gives you a 'root console'

Otherwise there is NO REASON AT ALL to need root, you ONLY need root to install updates and such once the OS is setup

What is the reason for wanting to log in as root, may I ask???

Revision history for this message
Todd Reichert (toddr30) said :
#2

Mostly I want to be able to try various effects on changes to config files,
etc. owned by root. I know the risk but I login as root sparingly and usr a
strong password.

-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of
actionparsnip
Sent: Thursday, February 24, 2011 3:05 PM
To: <email address hidden>
Subject: Re: [Question #146767]: root login

Your question #146767 on xserver-xorg-video-ati in ubuntu changed:
https://answers.launchpad.net/ubuntu/+source/xserver-xorg-video-ati/+questio
n/146767

    Status: Open => Needs information

actionparsnip requested for more information:
Its not supported or advise or necessary.Doing so is a MASSIVE security
risk. This shows some reasons and I believe how but you will have to
hack your system a LOT

I STRONGLY advise you stick to using sudo so you
a) Don't kill your system due to human error
b) Don't start running email apps and web browsers (stupidly) as root

https://help.ubuntu.com/community/RootSudo

If you need an interactive sudo, you can use:

sudo -i

and you will not be bothered for a password til you run:

exit

This effectively gives you a 'root console'

Otherwise there is NO REASON AT ALL to need root, you ONLY need root to
install updates and such once the OS is setup

What is the reason for wanting to log in as root, may I ask???

--
To answer this request for more information, you can either reply to
this email or enter your reply at the following page:
https://answers.launchpad.net/ubuntu/+source/xserver-xorg-video-ati/+questio
n/146767

You received this question notification because you are a direct
subscriber of the question.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

Its nothing to do with passwords, its about the processes you spawn.

You can run:

sudo -i

and get ALL the access you can need.

Revision history for this message
Best Eliah Kagan (degeneracypressure) said :
#4

@Todd Reichert
Please do not post with the complete text of the previous message included. It makes things very confusing for those of us who use the web interface at https://answers.launchpad.net/ubuntu/+question/146767 (which includes almost everyone who answers questions).

It is neither necessary nor desirable to be able to log on as root, in order to accomplish the tasks you wish to accomplish. Any user in the "admin" group (i.e. administrators) has the ability to run commands as root with "sudo", and to get a root shell which simulates a login shell with "sudo -i". Please see actionparsnip's post and the link therein.

If you want to run graphical programs as root, you can do that with "gksu". You can even create launchers in Nautilus that run commands prefixed with "gksu ". If you want to graphically browse and edit files as root, you can run Nautilus itself as root ("gksu nautilus" -- you can enter this command in the Terminal or in the Alt+F2 dialog box). If you open a file using that Nautilus window, the application that opens it (for example, a text editor) will be running as root.

If you don't understand what I have just said (or what actionparsnip said), or you are having trouble putting it into practice, please post again with details, and we'll help you.

Actually logging in as root is discouraged on Ubuntu systems. The OS is designed specifically to ensure that you never have to do that. This is widely considered to be a security benefit, since (1) if you log on as root (especially if it's a graphical login), you run lots more programs as root than you would by using sudo and gksu and (2) a lot of automated scripts designed to take control of people's computers for malicious purposes try to (remotely) log in as root, which might potentially work if root logins are enabled. A tiny security vulnerability in a program running as root could compromise your whole system, more so than if it were in a program ran as a limited user. A tiny stability bug in a program running as root could potentially break your whole system. Furthermore, you may experience some bugs if you log in as root graphically on Ubuntu; since this is nonstandard user behavior, many programs have not been extensively tested in this context.

With that said, if you understand that you do *not* need to log in as root to do what you want to do, and that you do *not* need to log in as root to do it easily and with GUI programs, and you *still* want to log in as root, then you can enable root logins by opening a Terminal window (Applications > Accessories > Terminal) and running the command:

sudo passwd root

To run a command, paste it in (or type it in exactly) and press enter. You will probably first be asked for your own password. (But it is possible that you will not be asked for your own password; this sometimes occurs if you have just recently performed some other administrative task, and your authentication for that is still current.) Once you have entered your own password, you will then be asked to enter root's new password, twice. Make sure this is a strong password, and it is best that it not be the same as your login password (mainly to prevent you from confusing your own account with the root account, which, on systems that have root logins enabled, is a very common mistake even among experienced users and system administrators). Then you can log in as root. If after this you still cannot log in as root, then you'll have to go to System > Administration > Login Screen and configure the login screen to allow you to type in the username of the user you wish to log in as (which, for root, is just "root").

By the way, when you enter passwords in the Terminal, you don't see any placeholder characters (like *). That's OK--just type them in and press enter.

Revision history for this message
Todd Reichert (toddr30) said :
#5

Thank you very much. I will take what you have said to heart an use sudo as advised.

Thanks again.

Revision history for this message
Richard Jones (richardosj) said :
#6

Having read the above responses; I am in agreement with the reasoning to avoid use of root; however, while attempting to install gEDA programs, there are many errors that say cannot open file, permission denied. The install was attempted using sudo as prefix to the apt-get commands. Some investigation showed those files to be owned by root. So if I changed heir file permissions to 777, some would be opened, some would not. Perhaps some other problem is occurring. Computer is running Ubuntu 18.04.3