LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 04-01-2012, 04:49 PM   #1
BigBack666
LQ Newbie
 
Registered: Mar 2012
Posts: 7

Rep: Reputation: Disabled
Quick question about root account.


Hey I guys I'm just getting started using linux on ubuntu 11.10 and I have a quick question. Lets say I have two accounts named tegan and sara. If I am logged in as tegan with access to the root account would I then be able to login as sara and also have access to the root? I'll try to explain this through the command line but remember I'm new!

tegan@pc:~$ su
passwd:
root@tegan:/home/tegan# login sara
passwd:
sara@tegan:~$ su

Would this be a possible command?

also would an account only be able to execute a "sudo" command if it has not been able to access the root yet?

Thanks guys and I'm looking forward to more questions in my new adventure with linux!

Last edited by BigBack666; 04-01-2012 at 04:51 PM.
 
Old 04-01-2012, 04:54 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
If you activated the root account, anybody could log in as root (assuming they have the password). So I'm not really sure what you're asking. Root is just another user (albeit with special privileges). You use "su" to switch between users, "su" without an argument switches to the root user (assuming it's been activated, it isn't by default on Ubuntu).

Once the root user has been activated, anybody on the system can type "su" at the command prompt, enter the root password, and become root.

Last edited by suicidaleggroll; 04-01-2012 at 04:56 PM.
 
Old 04-01-2012, 05:05 PM   #3
BigBack666
LQ Newbie
 
Registered: Mar 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
I guess what I was asking was say I was logged in as sara under tegan with root and I was trying to do a sudo command under sara but the system responded with "sara is not in the sudoers file." Is this because sara has not accessed root yet?
 
Old 04-01-2012, 05:09 PM   #4
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Switching users to root is completely different than being in the sudoer file and having sudo privileges.

sudo is a way to run super-user commands with only your regular user password
root is a separate user account that always has super-user privileges, and has its own password

You can log in as root from any user, and log in as any user from root, without affecting anybody's ability or inability to run sudo. sara's inability to run sudo is because sara is not in the sudoer file, it's not because that user has or has not su'd into the root account before.

I hope that makes sense. Part of the confusion might stem from the "su" acronym. In the case of the "su" command, "su" stands for switch user. It's the program used to switch to any other account on the system. You could type "su sara", or "su tegan" to switch to those users, or if left without an argument it defaults to root, same as typing "su root", ie: "switch user to root".

In the case of the "sudo" command, "su" stands for super-user, ie: "super-user do".

Last edited by suicidaleggroll; 04-01-2012 at 05:20 PM.
 
1 members found this post helpful.
Old 04-01-2012, 05:15 PM   #5
BigBack666
LQ Newbie
 
Registered: Mar 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
Alright I think I get it now thanks! I've always thought su only stood for superuser.

Last edited by BigBack666; 04-01-2012 at 05:25 PM.
 
Old 04-01-2012, 05:56 PM   #6
jmc1987
Member
 
Registered: Sep 2009
Location: Oklahoma
Distribution: Debian, CentOS, windows 7/10
Posts: 893

Rep: Reputation: 119Reputation: 119
su does stand for super user which makes you go root. But by default its disabled in Ubuntu. sudo is just a program designed to give a user predifined elevated privages. Which technically sudo doesn't make you root just gives you some root powers. "$sudo -f" will give you a root shell though if allowed via /etc/sudeors file.
 
Old 04-01-2012, 06:15 PM   #7
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Quote:
Originally Posted by jmc1987 View Post
su does stand for super user which makes you go root.
The program "su" does not stand for super user, it stands for switch user or substitute user. Nothing about that program is particular to root or the super user, except that if you call it without providing an argument, it defaults to root.

Code:
$ man su

NAME
       su - run a shell with substitute user and group IDs

SYNOPSIS
       su [OPTION]... [-] [USER [ARG]...]

DESCRIPTION
       Change the effective user id and group id to that of USER.

blah blah blah

       If USER not given, assume root.

Last edited by suicidaleggroll; 04-01-2012 at 06:17 PM.
 
Old 04-01-2012, 06:29 PM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,364

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
What he said; eg you can switch from user1 to uiser2 without invoking any rootly powers, you just need acctname+passwd.

Incidentally
Code:
su <user>
logs you in as target user, BUT with src user's env.
To get target user's env, insert '-' thus
Code:
su - <user>
 
Old 04-01-2012, 07:21 PM   #9
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,358
Blog Entries: 28

Rep: Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148
Just as an aside, my understanding is that, by default, Ubuntu puts the first user created (normally the user name picked by the person installing the software) in the sudoers file. Additional users must be added to sudoers by the priviledged user with sudo visudo.
 
Old 04-01-2012, 08:18 PM   #10
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Quote:
Originally Posted by chrism01 View Post
What he said; eg you can switch from user1 to uiser2 without invoking any rootly powers, you just need acctname+passwd.

Incidentally
Code:
su <user>
logs you in as target user, BUT with src user's env.
To get target user's env, insert '-' thus
Code:
su - <user>
Come on, chrism01, you were the one that initiated the "Use proper English"-rule, now you should stick with it.
 
Old 04-01-2012, 08:43 PM   #11
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,364

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Ouch .. actually I haven't checked that thread since my last post there ....
I admit I was thinking more of 'c u' 'ur' etc (assuming 'etc' is an acceptable shortening of et cetera).
Its always difficult to agree what abbreviation are acceptable & which aren't, although (technical) acronyms at least should be allowed.
In any case, it was only a suggestion for discussion, not a 'we must do this', if you see my posts there.


Just checked: LQ rules have not been amended yet ..

Last edited by chrism01; 04-01-2012 at 08:44 PM.
 
Old 04-01-2012, 08:49 PM   #12
jmc1987
Member
 
Registered: Sep 2009
Location: Oklahoma
Distribution: Debian, CentOS, windows 7/10
Posts: 893

Rep: Reputation: 119Reputation: 119
Quote:
Originally Posted by suicidaleggroll View Post
The program "su" does not stand for super user, it stands for switch user or substitute user. Nothing about that program is particular to root or the super user, except that if you call it without providing an argument, it defaults to root.

Code:
$ man su

NAME
       su - run a shell with substitute user and group IDs

SYNOPSIS
       su [OPTION]... [-] [USER [ARG]...]

DESCRIPTION
       Change the effective user id and group id to that of USER.

blah blah blah

       If USER not given, assume root.
Yes you are correct I totally slipped. I guess I've always referred to it as "Super User" as it use it to access any account including root.
 
  


Reply



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
howto log usage of shared account (root account) after `sudo su -` drManhattan Linux - Server 5 09-30-2011 07:48 AM
Kubuntu Question - How to run Pulseaudio in root account? Braxton Leo Linux - Software 1 03-30-2011 01:08 AM
is it legitimate and allowed and can be done to make another user account set uid and gid to null 0 to make another root account with different name and possibly not damage the debian system creating and using that new account BenJoBoy Linux - Newbie 12 01-29-2006 10:02 AM
Quick question. How do I log in as root. DDRfreak2 Mandriva 10 08-12-2005 09:47 PM
Question: Changing My Root Account Name eech55 *BSD 8 08-18-2004 03:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:56 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