LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 07-07-2007, 05:44 AM   #1
nikeody
LQ Newbie
 
Registered: Jul 2007
Posts: 1

Rep: Reputation: 0
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.
 
Old 07-07-2007, 06:37 AM   #2
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
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
Code:
$sudo passwd root
 
Old 07-07-2007, 06:38 AM   #3
camorri
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

Rep: Reputation: 920Reputation: 920Reputation: 920Reputation: 920Reputation: 920Reputation: 920Reputation: 920Reputation: 920
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.
 
Old 07-09-2007, 08:18 AM   #4
Elzix
LQ Newbie
 
Registered: Feb 2007
Location: Nairobi, Kenya
Distribution: Kubuntu 7.04 Feisty
Posts: 16

Rep: Reputation: 0
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]
 
Old 07-09-2007, 09:05 AM   #5
kshymkiw
Member
 
Registered: May 2006
Location: Columbus, Ohio
Distribution: Ubuntu 7.04, Debian
Posts: 48

Rep: Reputation: 15
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.
 
Old 07-09-2007, 09:17 AM   #6
Elzix
LQ Newbie
 
Registered: Feb 2007
Location: Nairobi, Kenya
Distribution: Kubuntu 7.04 Feisty
Posts: 16

Rep: Reputation: 0
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?
 
Old 07-09-2007, 09:42 AM   #7
kshymkiw
Member
 
Registered: May 2006
Location: Columbus, Ohio
Distribution: Ubuntu 7.04, Debian
Posts: 48

Rep: Reputation: 15
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.
 
Old 07-10-2007, 01:46 AM   #8
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,797

Rep: Reputation: 282Reputation: 282Reputation: 282
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).
Code:
sudo su -
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.
 
Old 07-11-2007, 12:48 PM   #9
kshymkiw
Member
 
Registered: May 2006
Location: Columbus, Ohio
Distribution: Ubuntu 7.04, Debian
Posts: 48

Rep: Reputation: 15
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).
Code:
sudo su -
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
 
Old 07-11-2007, 01:37 PM   #10
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,797

Rep: Reputation: 282Reputation: 282Reputation: 282
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.
 
Old 07-11-2007, 03:08 PM   #11
kshymkiw
Member
 
Registered: May 2006
Location: Columbus, Ohio
Distribution: Ubuntu 7.04, Debian
Posts: 48

Rep: Reputation: 15
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
 
Old 07-11-2007, 05:44 PM   #12
geek745
Member
 
Registered: Jul 2004
Location: Alton, IL
Distribution: Linux Mint; Slackware; Ubuntu; Slax
Posts: 172
Blog Entries: 2

Rep: Reputation: 34
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!
 
Old 07-11-2007, 06:23 PM   #13
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
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
Code:
AllowRoot=false
to
Code:
AllowRoot=true
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.
 
Old 07-11-2007, 11:34 PM   #14
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,797

Rep: Reputation: 282Reputation: 282Reputation: 282
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.
 
Old 07-12-2007, 05:51 AM   #15
Elzix
LQ Newbie
 
Registered: Feb 2007
Location: Nairobi, Kenya
Distribution: Kubuntu 7.04 Feisty
Posts: 16

Rep: Reputation: 0
Talking

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!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Allow Root to log in in ubuntu hallows1 Linux - General 8 04-04-2007 04:51 AM
NFS Root setup - can't log in as root after CHMOD ? gallwapa Linux - General 1 04-02-2007 05:31 AM
Cant only log in as root after user log-in. ADJenkins Linux - General 2 11-17-2004 05:18 PM
Log Out root Then Log In As Other User xtremcoder Linux - General 4 10-05-2004 12:01 AM
Log on as Root, or switch to Root, in MDK 9.1 - KDE 3.1.0 snorky Mandriva 3 09-01-2003 01:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 06:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration