LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-21-2011, 06:30 PM   #16
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,130
Blog Entries: 2

Rep: Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825

Quote:
Originally Posted by Arcane View Post
root is disabled on Ubuntu and you won't access it with sudo you will just execute stuff with root privileges but will stay in custom account name. This is why many people avoid Ubuntu because they need root account by default. If you compare it to Windows sudo is like "Run as" command where you execute something as admin while staying in limited user without logging in that account.
Sorry, but this is wrong. At first, root is not disabled in Ubuntu, it simply has a very long and secure random password. Also, if you use sudo to start a program that program will be started as user root, not as your normal user with more rights. You can simply test that with
Code:
sudo nano
then do a
Code:
ps aux | grep nano
on a different terminal and have a look who runs the nano-editor. And, as already stated by acid_kewpie, all init-scripts are runs as root. That is for example the reason, why you don't need to use sudo when adding commands that need root-privileges to rc.local.
 
Old 07-21-2011, 06:33 PM   #17
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
Root is not "disabled". People do not avoid ubutu for that reason. You want root? Fine have it. Ubuntu doesn't limit you from doing anything as root it just uses a more finely tuned model for how it recommends you use it.
 
Old 07-21-2011, 06:35 PM   #18
stormreactor
LQ Newbie
 
Registered: Jul 2011
Posts: 22

Original Poster
Rep: Reputation: Disabled
@Arcane - Are you sure? I can easily access the user named 'root' by entering "sudo su" (exactly like that and without the quotes) in an Ubuntu terminal. I don't think it's actually disabled. I just think it just doesn't have direct accessibility without using sudo, unless just some command line output that just imitates 'root'.

@unSpawn - Thanks for the reference. I'll definitely look into it if I actually do need to build my own kernel. Also, sorry for the 'root' name-bashing rant in my earlier post. I suppose it was a bit out of place.

@acid_kewpie - Thanks for the info! The 'distro', if I should even call it that, will be very stripped-down. It won't have a GUI or even --gasp-- cron if I could get away with it. I just saw your most recent post. I had no idea about "sudo -i". Same function as "sudo su", I suppose.
__________________________

EDIT: Wow! This thread is updating so fast! Even this reply is outdated.

EDIT 2: Spelling correction. Paragraph 1: "accessibly" -> "accessibility"

Last edited by stormreactor; 07-21-2011 at 06:56 PM.
 
Old 07-21-2011, 06:36 PM   #19
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
Quote:
Originally Posted by TobiSGD View Post
Sorry, but this is wrong. At first, root is not disabled in Ubuntu, iis thet simply has a very long and secure random password. Also, if you use sudo to start a program that program will be started as user root, not as your normal user with more rights. You can simply test that with
Code:
sudo nano
then do a
Code:
ps aux | grep nano
on a different terminal and have a look who runs the nano-editor. And, as already stated by acid_kewpie, all init-scripts are runs as root. That is for example the reason, why you don't need to use sudo when adding commands that need root-privileges to rc.local.
Is the password legal? I thought it just had a. "!" In the crypt string or something to make it impossible to match. That would be the "disable " as far as it could be described as such.
 
Old 07-21-2011, 06:39 PM   #20
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
Sudo su - is one command nested in another. Yuck. Sudo -i is all within sudo and the resulting environment has useful variables like SUDO_USER and other useful things. It's a more recent addition though. In rhel5 but not rhel4 for example.
 
1 members found this post helpful.
Old 07-21-2011, 06:43 PM   #21
stormreactor
LQ Newbie
 
Registered: Jul 2011
Posts: 22

Original Poster
Rep: Reputation: Disabled
@acid_kewpie - Thanks for that. Just realized that "sudo -i" doesn't need a password as a result. Using that from now on.

Okay, back on topic, as for the whole "rename 'root'" thing, I'm going to install a distro in VirtualBox and try renaming 'root'. (I might need a bit of help with that, though.) And if it works, I'll totally post the results.

Any recommendations on a VERY lightweight distro of Linux? ^_^"
 
Old 07-21-2011, 06:47 PM   #22
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,130
Blog Entries: 2

Rep: Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825
Quote:
Originally Posted by acid_kewpie View Post
Is the password legal? I thought it just had a. "!" In the crypt string or something to make it impossible to match. That would be the "disable " as far as it could be described as such.
Sorry, don't know that.

Quote:
Any recommendations on a VERY lightweight distro of Linux? ^_^"
It may be a bit longer to learn that, but for your purpose I would recommend to go the way through LFS to get a better understanding of the whole system. If you don't want that, VERY lightweight distributions are Tinycore (or, if you don't need GUI better Microcore) and Slitaz, which also have a version without GUI. The Slitaz scratchbook may also help you to set up a basic system that is tailored to your needs.

Last edited by TobiSGD; 07-21-2011 at 06:49 PM.
 
1 members found this post helpful.
Old 07-21-2011, 06:50 PM   #23
Arcane
Member
 
Registered: May 2006
Location: Latvia, Europe
Distribution: random
Posts: 303

Rep: Reputation: 233Reputation: 233Reputation: 233
Quote:
Originally Posted by stormreactor View Post
@Arcane - Are you sure? I can easily access the user named 'root' by entering "sudo su" (exactly like that and without the quotes) in an Ubuntu terminal. I don't think it's actually disabled. I just think it just doesn't have direct accessibly without using sudo, unless just some command line output that just imitates 'root'.{...}
People read please that link i posted from official Ubuntu website. Ubuntu gives your user admin rights but unlike other distros it hides root so you don't have it by default without executing special commands. And it asks your user password not root password for sudo. Some quotes to get you interested to click on that link:
Code:
By default, the Root account password is locked in Ubuntu.
Code:
Just remember, when sudo asks for a password, it needs YOUR USER password, and not the Root account password.
If it doesn't ask for root password it shows user is in admin group.
Code:
Enabling the Root account is rarely necessary. Almost everything you need to do as administrator of an Ubuntu system can be done via sudo or gksudo. If you really need a persistent Root login, the best alternative is to simulate a Root login shell using the following command...
It is all just misunderstanding. I just said Ubuntu works different from rest of distros which it does.
 
Old 07-21-2011, 06:54 PM   #24
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 720Reputation: 720Reputation: 720Reputation: 720Reputation: 720Reputation: 720Reputation: 720
But when you use sudo, it still doesn't "stay in custom account name", as you claimed.

You can "re-enable" Ubuntu's root account like this:

Code:
sudo passwd
Enter your new root password when it prompts you, and now it's just like any other distro.
 
1 members found this post helpful.
Old 07-21-2011, 06:59 PM   #25
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,241

Rep: Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325
As mentioned above, in reality (in special handling inside kernel etc) it's all about the uid = 0, rather than the actual string name 'root'.
You could try(?) renaming the root username, but remember that the uid for the 'SysAdmin' is still hardcoded as zero and you'd have to do your own kernel (and prob a few other tools) to get around that.
More trouble than it's worth imho.

The use of the word root for SysAdmin and root of the dir tree goes back to at least 1970 when Unix was invented, so I'd say the widespread use of there word nowadays for various stuff is derived from that, it's not the other way around as some earlier posts seem to imply.
 
Old 07-21-2011, 07:00 PM   #26
stormreactor
LQ Newbie
 
Registered: Jul 2011
Posts: 22

Original Poster
Rep: Reputation: Disabled
Thanks TobiSGD. I'll definitely give Micro Core a whirl. As for LFS, I'm probably going to have to follow it to build my crippled mobile distro at some point, anyway. Thanks for the rec! Downloading as we... type.
 
Old 07-21-2011, 07:00 PM   #27
Arcane
Member
 
Registered: May 2006
Location: Latvia, Europe
Distribution: random
Posts: 303

Rep: Reputation: 233Reputation: 233Reputation: 233
Quote:
Originally Posted by MTK358 View Post
But when you use sudo, it still doesn't "stay in custom account name", as you claimed.{...}
Have you used Ubuntu? It stays. Ok example
Code:
ubuntu@ubuntu# sudo firefox
Enter password: *****
ubuntu@ubuntu# instead of root@ubuntu#
 
Old 07-21-2011, 07:04 PM   #28
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,130
Blog Entries: 2

Rep: Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825
Quote:
Originally Posted by Arcane View Post
Have you used Ubuntu? It stays. Ok example
Code:
ubuntu@ubuntu# sudo firefox
Enter password: *****
ubuntu@ubuntu# instead of root@ubuntu#
But the Firefox of this example is launched as root, it doesn't stay in your users account. You can achieve the same behavior on any distro with a "real" root-account with
Code:
su -c firefox
Of course it is not recommended to use Firefox as root.
 
Old 07-21-2011, 07:07 PM   #29
stormreactor
LQ Newbie
 
Registered: Jul 2011
Posts: 22

Original Poster
Rep: Reputation: Disabled
@Arcane - When I do that, it actually does say "root@ubuntu" if I use "sudo su" or "sudo -i". I'm using 11.04 (Natty Narwhal).

@chrism01 - Thanks for that. Yeah, I'm definitely going to try and rename 'root'. Having the system administrator at UID 0 is no problem. ^_^
 
Old 07-21-2011, 07:12 PM   #30
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,241

Rep: Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325
Just ensure your new 'root' doesn't try to use that uid ...
Usernames are like DNS names, they're just there for human convenience; in reality it's all done with numbers underneath
 
  


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
[SOLVED] how can i remount root filesystem as read/write after modify readonly-root file jcwkyl Linux - Newbie 3 12-21-2010 11:40 PM
Adding root privaliges to user accounts or auto login as root Val-Ent Linux - General 15 03-02-2010 05:27 PM
How can I have a script owned as root and run as root by a user: setuid? stickey bit? abefroman Linux - Newbie 9 04-19-2008 06:15 PM
why lftp command run failed when user isn't root, but ok when logining as root steven_yu Linux - Software 0 06-06-2007 09:36 PM
root files: create as root:root or root:wheel? pcass Linux - Security 1 02-07-2004 05:14 PM


All times are GMT -5. The time now is 05:30 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration