LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to assign user groups properly? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-assign-user-groups-properly-597864/)

Mountain 11-07-2007 03:33 PM

How to assign user groups properly?
 
I just installed Ubuntu 7.10 server (no GUI). I created one user. What do I do next? If this was Windows, I might make the user a member of the admin group or power users group, tweak the profile settings, and that kind of stuff.

What do I do on Linux to make this user account usable for completing the setup and installation tasks I'll need to do?

Thanks.

complich8 11-07-2007 04:05 PM

on ubuntu, your first user should already be a member of the group "admin", which grants you sudo access.

To perform a task you'd normally need to do as root, you'll just want to prefix it "sudo ls" instead of "ls".

You can also use "sudo -s" or "sudo su - " to obtain a shell either as a privileged version of you, or as the actual user root.

You can add a user to given groups using gpasswd (eg: gpasswd -a username groupname).

You may also want to check out the man pages for aptitude, to get updates and install software.

Mountain 11-07-2007 05:22 PM

Quote:

Originally Posted by complich8 (Post 2951401)
on ubuntu, your first user should already be a member of the group "admin", which grants you sudo access.

To perform a task you'd normally need to do as root, you'll just want to prefix it "sudo ls" instead of "ls".

You can also use "sudo -s" or "sudo su - " to obtain a shell either as a privileged version of you, or as the actual user root.

You can add a user to given groups using gpasswd (eg: gpasswd -a username groupname).

You may also want to check out the man pages for aptitude, to get updates and install software.

Initially my only user was "root". I created one more user with 'adduser'. But I suspected I should set permissions and group membership next... still not sure how to do that.

Where do I find info about which user accounts and groups exist? I learned about the user command for printing who is logged in, but I want to see which accounts exist.

Is aptitude related to apt-get? Looks like it is... Thanks.

inspiron_Droid 11-07-2007 06:03 PM

In ubuntu tou would typ usermod - g group name [username]

Mountain 11-07-2007 06:17 PM

maybe these are the wrong questions... am I thinking too much like a Windows admin?

which group(s) should I add my user to?
how do I list the existing groups?
where do I learn more about user management?

I'm using Ubuntu 7.10, but the help at this link assumes there is a GUI:
https://help.ubuntu.com/7.04/keeping...l#users-groups

complich8 11-07-2007 11:42 PM

"usermod -g" sets a user's primary group. gpasswd is good for adding a user to additional groups.

For starters, I suggest "man 5 passwd", "man 5 shadow" and "man 5 group" to get the most basic info. The "whatis" and "apropos" commands are pretty handy, and if you're new to linux in general you should get comfortable with them and the man pages.

For a quick summary, user credentials are stored in /etc/passwd (world-readable, defines login, userid, primary group membership, shell, some other meta-info, but unintuitively doesn't include password hashes despite the name), /etc/shadow (stores just username, uid, password hash and some other password meta-info you probably don't care about right now, definitely should be readable only by root), and /etc/group (defines what groups exist, and what additional groups the users are in). You should probably be somewhat familiar with the contents of all three files.

As far as learning a lot about a lot, honestly I'd recommend either O'reilley's "Essential System Administration" ... or if you're feeling in more of a "free as in beer" mood, consider reading over the linux documentation project's sysadmin guide.

Mountain 11-08-2007 12:22 AM

Thank you. That's very helpful.


All times are GMT -5. The time now is 11:22 PM.