Ubuntu This forum is for the discussion of Ubuntu Linux. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
07-07-2007, 05:44 AM
|
#1
|
LQ Newbie
Registered: Jul 2007
Posts: 1
Rep:
|
Ubuntu - Log On to Root ?
Hello all, am new to Linux and very new to Ubuntu.
Just to get the ball rolling I want to log on as root to change the delay time on the GRUB screen [fil eis read only].
There is a ROOT User but all I get when I try to Log On as root is I am 'logging on at the wrong screen' - there is no reference to the correct screen !
Can someone help a newbie please ? Thanks.
|
|
|
07-07-2007, 06:37 AM
|
#2
|
LQ Guru
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298
Rep:
|
Ubuntu does not enable root logins by default. You have to use sudo as a normal user e.g.
Code:
$sudo vim /boot/grub/menu.lst
You can enable the root account by doing
|
|
|
07-07-2007, 06:38 AM
|
#3
|
LQ 5k Club
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,322
|
Ubuntu is a little different than other distros. There is a root user, but the system comes set up so you do not have to log on as root to do root things.
To do root functions, use the command 'sudo command' where command is the thing you want to do. Since you want to edit the menu.lst file with an editor, run 'sudo gedit' ( with out quotes ) and this will prompt you for the root password, and launch the editor gedit as root. Then you can open the file and edit it. Use any editor you like, I just used gedit as an example.
It is possible to change the behavior of Ubuntu so you can 'su' and password to root. It has been a while since I did it, so I would have to look up how. There is a how-to on Ubuntu's forum.
|
|
|
07-09-2007, 08:18 AM
|
#4
|
LQ Newbie
Registered: Feb 2007
Location: Nairobi, Kenya
Distribution: Kubuntu 7.04 Feisty
Posts: 16
Rep:
|
Just one question.
At the place where one logs in, it says "Root logins not allowed". Are these commands used to change this...
OR
Are these commands to log into root, through the console/terminal, under a normal user's interface...?
--------------------------------------------------------------------------------
I would really love to login into root without the console/terminal and change the rights of writing into '/var/cache/apt/archives',
so that I don't have to type in the names of all the 100's of
Code:
dpkg -i *.deb *.deb *.deb *.deb *.deb *.deb
just cuz I don't have internet on my linux PC at home!
--------------------------------------------------------------------------------
Last edited by Elzix; 07-09-2007 at 08:39 AM.
Reason: learn how to wrap text with [CODE]
|
|
|
07-09-2007, 09:05 AM
|
#5
|
Member
Registered: May 2006
Location: Columbus, Ohio
Distribution: Ubuntu 7.04, Debian
Posts: 48
Rep:
|
Quote:
Originally Posted by Elzix
Just one question.
At the place where one logs in, it says "Root logins not allowed". Are these commands used to change this...
OR
Are these commands to log into root, through the console/terminal, under a normal user's interface...?
--------------------------------------------------------------------------------
I would really love to login into root without the console/terminal and change the rights of writing into '/var/cache/apt/archives',
so that I don't have to type in the names of all the 100's of
Code:
dpkg -i *.deb *.deb *.deb *.deb *.deb *.deb
just cuz I don't have internet on my linux PC at home!
--------------------------------------------------------------------------------
|
You still wouldn't need to log into Root to do that.
From command line:
sudo chmod 755 -R /var/cache/apt/archives
-R is a recurssive command, that applies to all files and folders under that directory.
|
|
|
07-09-2007, 09:17 AM
|
#6
|
LQ Newbie
Registered: Feb 2007
Location: Nairobi, Kenya
Distribution: Kubuntu 7.04 Feisty
Posts: 16
Rep:
|
So... What your telling me is that, if I want right to everything:
I should not look for a way to get the root login to work...
but
To use
Code:
sudo chmod 755 -R /
instead?
|
|
|
07-09-2007, 09:42 AM
|
#7
|
Member
Registered: May 2006
Location: Columbus, Ohio
Distribution: Ubuntu 7.04, Debian
Posts: 48
Rep:
|
Quote:
Originally Posted by Elzix
So... What your telling me is that, if I want right to everything:
I should not look for a way to get the root login to work...
but
To use
Code:
sudo chmod 755 -R /
instead?
|
Conceieveably you could do it. but doing
Code:
sudo chmod 755 -R /
would only make Folders and Files directly under "/" 755. For example a file in this directory /folder/hello.txt would still be at it's origional setting, while the folder would be at 755.
I would not enable the root login, as it just creates a huge security hole IMO.
|
|
|
07-10-2007, 01:46 AM
|
#8
|
Senior Member
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,797
|
Quote:
Originally Posted by Elzix
So... What your telling me is that, if I want right to everything:
I should not look for a way to get the root login to work...
but
To use
Code:
sudo chmod 755 -R /
instead?
|
First of all, the command does not do what you want to use it for. For some commands you need root privileges. Making the files executable for everybody does not give everybody root privileges. So the command is useless in this case (in my opinion) and dangerous (see below).
Just use sudo; to get more permanent root privileges (for a number of commands), I think that you can use (although I have never used it).
One of the posts above showed the command to enable the root account. I've enabled my root account although I mostly use sudo.
Note that it only enables the account so you can login in a terminal or so you can use su - to gain root privileges. It will however not allow login as root in GDM/KDM; there is an additional setting in one of the config files to allow that. For security reasons this is not advisable.
Also, you can not execute commands with a graphical interface as root (you will get a message that you don't own the screen (or something similar)).
Quote:
Originally Posted by kshymkiw
but doing
Code:
sudo chmod 755 -R /
would only make Folders and Files directly under "/" 755. For example a file in this directory /folder/hello.txt would still be at it's origional setting, while the folder would be at 755.
|
Correct me if I'm wrong, but I doubt if that's the case. It makes everything executable by everybody; the -R option makes it recursive.
And that is NOT what one wants; it even makes documents and images executable without any reason (and is dangerous as it might be a text file just containing a command to delete everything).
PS: The syntax is wrong as far as I know. The -R should go directly after the command.
Code:
sudo chmod -R 755 /
Last edited by Wim Sturkenboom; 07-10-2007 at 01:49 AM.
|
|
|
07-11-2007, 12:48 PM
|
#9
|
Member
Registered: May 2006
Location: Columbus, Ohio
Distribution: Ubuntu 7.04, Debian
Posts: 48
Rep:
|
Quote:
Originally Posted by Wim Sturkenboom
First of all, the command does not do what you want to use it for. For some commands you need root privileges. Making the files executable for everybody does not give everybody root privileges. So the command is useless in this case (in my opinion) and dangerous (see below).
Just use sudo; to get more permanent root privileges (for a number of commands), I think that you can use (although I have never used it).
One of the posts above showed the command to enable the root account. I've enabled my root account although I mostly use sudo.
Note that it only enables the account so you can login in a terminal or so you can use su - to gain root privileges. It will however not allow login as root in GDM/KDM; there is an additional setting in one of the config files to allow that. For security reasons this is not advisable.
Also, you can not execute commands with a graphical interface as root (you will get a message that you don't own the screen (or something similar)).
Correct me if I'm wrong, but I doubt if that's the case. It makes everything executable by everybody; the -R option makes it recursive.
And that is NOT what one wants; it even makes documents and images executable without any reason (and is dangerous as it might be a text file just containing a command to delete everything).
PS: The syntax is wrong as far as I know. The -R should go directly after the command.
Code:
sudo chmod -R 755 /
|
The -R recurssive option, only works for Files and Folders directly under the defined path.
Correct you would never want to do chmod 755 -R /. It is conceiveably possible, but not something you want to do. where as if you need to make something readable in Apache/PERL/CGI then the -R comnnad helps.
as well in all my exmaples i had advised him to use sudo chmod 755 -R you seem to have flipped the -R and 755 around
|
|
|
07-11-2007, 01:37 PM
|
#10
|
Senior Member
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,797
|
I think the confusion comes from the position of the -R. I assumed it was a mistake.
Quote:
chmod [OPTION]... OCTAL-MODE FILE...
|
So please explain what your version of the command is supposed to do and where I can find info about it; I don't see it in the man page.
|
|
|
07-11-2007, 03:08 PM
|
#11
|
Member
Registered: May 2006
Location: Columbus, Ohio
Distribution: Ubuntu 7.04, Debian
Posts: 48
Rep:
|
Quote:
Originally Posted by Wim Sturkenboom
I think the confusion comes from the position of the -R. I assumed it was a mistake.
So please explain what your version of the command is supposed to do and where I can find info about it; I don't see it in the man page.
|
your right it is chmod -R xxx I was mistaken, thinking way ahead of myself
|
|
|
07-11-2007, 05:44 PM
|
#12
|
Member
Registered: Jul 2004
Location: Alton, IL
Distribution: Linux Mint; Slackware; Ubuntu; Slax
Posts: 172
Rep:
|
ok, things were getting confusing there.
If you want to login as root on Ubuntu, where the root account is disabled by default, do
sudo su root
to set root's password.
Then use the account. If you want to disable it again, do
sudo pico /etc/passwd
And set the login shell (listed toward the end of the list there, probably /bin/sh) to something that obviously does not exist (like /bin/nologin) or something. Then it will not be possible to
su - or login as root
because there is no login terminal specified. You can also take a look at the entries for various system daemon users that are not allowed login, it is either ! or * in the second item in /etc/shadow. A line for a normal user would look like:
user:-A2fb96+45Jd:501:501::::: or something similar. The first unintelligible string is the encrypted password. You would delete this if you wanted the user to create his own password after logging into his account with a blank one, or set it to ! or * to disable his login; just do this for that root user you need to disable.
It is possible when running as a normal user to run applications with root permissions. I run konsole and konqueror all the time as root. Use the "Run Application..." or similar dialog (Alt+F2 default shortcut), enter the application name, and specify in the options to run as another user. Your windowing environment will render that app with all of that user's settings (like if you set the bgcolor to red for the super users file manager or something, only that super user file manager will be red when you run it in your normal session), and with that user's permissions. You will be required to provide a password.
Hope that helps!
|
|
|
07-11-2007, 06:23 PM
|
#13
|
Senior Member
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Rep:
|
I will summarize the situation as follow
(1) Use sudo
There is a lot a user can do by prefix privileged commands with "sudo" in Ubuntu.
(2) To activate root user account permanently in a Ubuntu terminal.
Ubuntu has a root account but does not allow access during installation. In post installation an ordinary user can change the root's password and the way to do it is like reddazz indicated in Post #2. Yes it is strange isn't it? but it is true Thereafter the user can always type "su" at the terminal to become the root user. He/she is still denied from log in as root to the desktop though.
(3) To log in as root to the desktop (the ultimate)
An ordinary user can edit /etc/gdm/gdm.conf by changing the line
to
Thereafter he/she can log in as root to the desktop just like the other Linux.
Therefore YES! you can do whatever you want in Ubuntu BUT that is not what Ubuntu wants. Ubuntu makes its distro different because log in as an ordinary user is the most secure way to operate a Linux because the files ownership will prevent any attack to the root system. If everybody log in as root then the Linux will end up like a MS Windoze getting infected and attacked constantly.
I happen to agree.
And if I may say so how mature you are in Linux can be measured by how much you need to be in root. So distant yourself from the root user whenever possible unless you have a need and do not know the other way.
Last edited by saikee; 07-11-2007 at 06:26 PM.
|
|
|
07-11-2007, 11:34 PM
|
#14
|
Senior Member
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,797
|
Quote:
Originally Posted by kshymkiw
your right it is chmod -R xxx I was mistaken, thinking way ahead of myself
|
In which case I like to make clear that it will set the permissions for all directories and files under the specified directory.
Quote:
Originally Posted by geek745
If you want to disable it again, do
sudo pico /etc/passwd
And set the login shell (listed toward the end of the list there, probably /bin/sh) to something that obviously does not exist (like /bin/nologin) or something. Then it will not be possible to
su - or login as root
because there is no login terminal specified. You can also take a look at the entries for various system daemon users that are not allowed login, it is either ! or * in the second item in /etc/shadow. A line for a normal user would look like:
user:-A2fb96+45Jd:501:501::::: or something similar. The first unintelligible string is the encrypted password. You would delete this if you wanted the user to create his own password after logging into his account with a blank one, or set it to ! or * to disable his login; just do this for that root user you need to disable.
|
To prevent mistakes, it's safer to use sudo -l to lock the account again.
Quote:
Originally Posted by saikee
If everybody log in as root then the Linux will end up like a MS Windoze getting infected and attacked constantly.
|
That's why I did not want to explain what needed to be changed. Maybe a bit childish or selfish.
Last edited by Wim Sturkenboom; 07-11-2007 at 11:40 PM.
|
|
|
07-12-2007, 05:51 AM
|
#15
|
LQ Newbie
Registered: Feb 2007
Location: Nairobi, Kenya
Distribution: Kubuntu 7.04 Feisty
Posts: 16
Rep:
|
Quote:
An ordinary user can edit /etc/gdm/gdm.conf by changing the line
Code:
AllowRoot=falseto
Code:
AllowRoot=trueThereafter he/she can log in as root to the desktop just like the other Linux.
Therefore YES! you can do whatever you want in Ubuntu BUT that is not what Ubuntu wants. Ubuntu makes its distro different because log in as an ordinary user is the most secure way to operate a Linux because the files ownership will prevent any attack to the root system. If everybody log in as root then the Linux will end up like a MS Windoze getting infected and attacked constantly.
I happen to agree.
|
Finally! the answer I was lookin for.. I got linux so I can learn how it works, inside-out.. It's the same way ppl can learn Windoz easy.. Once I know how to use it, only then is security an issue.. Thanks for freeing 'us' from the darkness!
|
|
|
All times are GMT -5. The time now is 06:11 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|