Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: ubuntu 10.04 and root?
PostPosted: Tue Aug 10, 2010 9:10 pm 
Offline
Newbie

Joined: Tue Aug 10, 2010 7:15 pm
Posts: 4
I am a newb with all this and I have a question about the best way to change the default user.
When I install ubuntu 10.04 on a local PC it sets up a user with root privileges and disables the root password. However when I select the linode version I have to ssh as root. As I understand it this is a security issue that I need to change. But how do I create a new user that can act as the root and then disable the root?
I have tried searching here and google but it is info overload and confusing.


Top
   
 Post subject:
PostPosted: Tue Aug 10, 2010 10:06 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Read this http://library.linode.com/beginners-guide/


To solve your immediate problem do the following

Code:
adduser <username>
replacing <username> with your desired username then run
Code:
visudo
and add
Code:
<username>   ALL=(ALL) ALL

again replacing <username> with your desired username
Then type
Code:
passwd -l root
to lock out the root account.


Top
   
 Post subject:
PostPosted: Tue Aug 10, 2010 10:54 pm 
Offline
Newbie

Joined: Tue Aug 10, 2010 7:15 pm
Posts: 4
Thankyou so much :D
I have read the beginners-guide several times but I had not found a reference to visudo. I did find one on google but it was confusing.


Top
   
 Post subject:
PostPosted: Wed Aug 11, 2010 1:46 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
I imagine it's in there somewhere, if not you can email docs@linode.com and they can add it.


Top
   
 Post subject:
PostPosted: Wed Aug 11, 2010 4:36 am 
Offline
Senior Member
User avatar

Joined: Sun Dec 27, 2009 11:12 pm
Posts: 1038
Location: Colorado, USA
For decades, across numerous platforms, Nix Admins managed to safely use the 'root' account.

Then Ubuntu comes along and assumes it's users are too stupid to be trusted with it.


Top
   
 Post subject:
PostPosted: Wed Aug 11, 2010 7:54 am 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
Not entirely a bad assumption. We all know how Windows turned out...

History has found that the safest way to use the root account is to not use the root account. That's how the greybeards pull it off.


Top
   
 Post subject:
PostPosted: Wed Aug 11, 2010 7:57 am 
Offline
Senior Member

Joined: Wed May 13, 2009 1:18 am
Posts: 681
I don't know - as one of those people who, as you say, has safely managed to use the root account for decades, I've actually grown to like the sudo approach on those systems where it is used. Having to think a little extra, and include a few more characters, before issuing administrative commands isn't that bad an idea, and the cached authorization is nice when switching among accounts other than root. It isn't really that often that you need to execute a whole lot of commands all of which need such access.

And if I really want it the old way, sudo with "-i" or "-s" isn't much different than a plain "su".

-- David


Top
   
 Post subject:
PostPosted: Wed Aug 11, 2010 5:38 pm 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
One reason it could be a good idea to lock the root account is that it's easily guessable. Every Linux box has an account named "root". It's an easy target for script kiddies. Sure, you can disable root login from SSH. But not allowing anybody to log in as root (even from the console, in case somebody steals your Lish key) arguably makes for an additional layer of security.


Top
   
 Post subject:
PostPosted: Wed Aug 11, 2010 5:50 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Eh hybinet's argument is probably the best, I still use sudo -i all the time since the only time I ssh in is to edit a configuration file or restart which all require root access.


Top
   
 Post subject:
PostPosted: Wed Aug 11, 2010 10:54 pm 
Offline
Senior Member

Joined: Sun May 23, 2010 1:57 pm
Posts: 315
Website: http://www.jebblue.net
Never use visudo on Ubuntu. Use sudo. It's that simple. Use it only when you need to.


Top
   
 Post subject:
PostPosted: Wed Aug 11, 2010 11:35 pm 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
jebblue wrote:
Never use visudo on Ubuntu. Use sudo.


Huh? :roll:


Top
   
 Post subject:
PostPosted: Thu Aug 12, 2010 1:43 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
*Double huh?*


Top
   
 Post subject:
PostPosted: Thu Aug 12, 2010 9:47 am 
Offline
Senior Newbie

Joined: Sat Jul 17, 2010 8:32 am
Posts: 12
It is quite ironic that you disable the root account and grant ALL permissions to the newly created shell account.

I doubt that it would be that much difficult to get a root shell when you have a shell account with all permissions.

What is the point?


Top
   
 Post subject:
PostPosted: Thu Aug 12, 2010 12:26 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
I think the point is 1) script kiddies don't know your username (shouldn't be a problem anyway but for novices better safe than sorry, 2) It makes you think before you do that rm -rf / ;)


Top
   
 Post subject:
PostPosted: Thu Aug 12, 2010 1:45 pm 
Offline
Senior Newbie

Joined: Sat Jul 17, 2010 8:32 am
Posts: 12
The first would hardly be a problem as you yourself have mentioned. As for the second point...well, I'd be shooting myself in the head if I did that. I know that it isn't impossible; I have nearly done that on a developmental server before in a moment of cheekiness.

Then again, some practices never die. :roll:


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group