Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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?
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.
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.
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.
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.
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 ..
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.