understanding root, sudo, new install

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
achan1989
Level 1
Level 1
Posts: 2
Joined: Fri Jun 25, 2010 9:34 pm

understanding root, sudo, new install

Post by achan1989 » Fri Jun 25, 2010 10:02 pm

Sorry if this is addressed somewhere, I've tried searching but no dice.

I'm a bit confused by the whole root issue when installing. As I understand it the root account has no password and is effectively blocked. However the first user added to the system in the install gets sort-of admin priviledges or something? The user guide says "your root password is the same as the password you chose during the installation" which seems counter-intuitive...

Maybe if I describe the setup I want it would be easier. I intend to admin the computer for my family and I don't want them to be able to sudo anything with their passwords, and I don't want an account myself unless its necessary. What would be the best way of doing this?

User avatar
oobetimer
Level 7
Level 7
Posts: 1878
Joined: Tue Jun 01, 2010 12:53 pm
Location: Finland / above the Arctic Circle
Contact:

Re: understanding root, sudo, new install

Post by oobetimer » Fri Jun 25, 2010 10:14 pm

achan1989 wrote:Sorry if this is addressed somewhere, I've tried searching but no dice.

I'm a bit confused by the whole root issue when installing. As I understand it the root account has no password and is effectively blocked. However the first user added to the system in the install gets sort-of admin priviledges or something? The user guide says "your root password is the same as the password you chose during the installation" which seems counter-intuitive...

Maybe if I describe the setup I want it would be easier. I intend to admin the computer for my family and I don't want them to be able to sudo anything with their passwords, and I don't want an account myself unless its necessary. What would be the best way of doing this?
Don't tell them your sudo password.. 8)

You can make an account without using it..

JasonLG
Level 7
Level 7
Posts: 1612
Joined: Thu May 20, 2010 9:15 pm
Location: Polk City, Iowa USA

Re: understanding root, sudo, new install

Post by JasonLG » Fri Jun 25, 2010 10:20 pm

The easiest and safest thing to do would be to give yourself an account with admin privileges and add accounts for everyone else with user privileges. I wouldn't recommend logging in as root especially since you are new to Linux. The reason is that while logged in as root there are no warnings a mistyped command in the terminal can totally b0rk your entire system.
"I see" said the blind man to the deaf man who stuck his wooden leg out the window to check the weather.

User avatar
RedWagon
Level 5
Level 5
Posts: 632
Joined: Tue May 26, 2009 6:41 pm

Re: understanding root, sudo, new install

Post by RedWagon » Fri Jun 25, 2010 10:30 pm

EDIT: a couple people beat me to it, but there should still be some helpful info here...
As I understand it the root account has no password and is effectively blocked.
This is Ubunut's method.
your root password is the same as the password you chose during the installation
This is how Mint does it. It's one of the few areas like this that the two differ.

sudo lets users run things as admin. This is recommended over logging in as root because it's considered bad security practice to run commands as root when not necessary because of security reasons and the higher potential for accidentally or unintentionally messing something up. Also, logging in as root to a graphical environment can wreak havoc on some distros.

I think one of the reasons Ubuntu decided to block the root account was the overuse it was getting from newbies. They figure out that every time they run into a permissions issue, using root lets them "solve" the problem. After awhile they start wondering why they need to even bother with their standard account and pretty soon they're running almost everything as root.
I intend to admin the computer for my family and I don't want them to be able to sudo anything with their passwords, and I don't want an account myself unless its necessary. What would be the best way of doing this?
Not 100% sure what you want, but here are a few suggestions:
1. Create one account, set it to auto login, don't tell your family the password. They'll be able to do everything a normal user can, but won't be able to run commands as root through sudo.
2. Create multiple accounts without root access, plus an account for you with root access. I know you don't want one, but just because you have one doesn't mean you have to use it. It'll just be a lot better to use than logging in as root and accounts don't take up much room. The ability to use the sudo command is determined by the /etc/sudoers file. You don't need to edit this though, as long as you create your families accounts as normal users and not admins running sudo won't do anything. It'll just fail to run the command.

achan1989
Level 1
Level 1
Posts: 2
Joined: Fri Jun 25, 2010 9:34 pm

Re: understanding root, sudo, new install

Post by achan1989 » Sat Jun 26, 2010 8:46 am

Thanks for the help.

I've set my family up with individual accounts without root access. I also have my account (initial one from install) which can do admin. Currently the family accounts are not in sudoers, so if there is admin stuff to do I have to su to my admin account then sudo, which is not ideal. I read somewhere that it's possible to change the password that sudo requires, can I use this to allow family accounts to sudo with my password but not theirs?

User avatar
RedWagon
Level 5
Level 5
Posts: 632
Joined: Tue May 26, 2009 6:41 pm

Re: understanding root, sudo, new install

Post by RedWagon » Sat Jun 26, 2010 11:13 am

can I use this to allow family accounts to sudo with my password but not theirs?
not that I know of, but you can use su to run stuff under your name while they are logged in. Just open a terminal window and run

Code: Select all

su admin_account

Post Reply

Return to “Newbie Questions”