I’ve been asked here on my blog about creating user accounts and giving them access to folders such as /var/www or creating ftp users that link to a single folder. That was quite a while ago. Since then i have picked up quite a bit about user management and thought that i would let you in on my findings.
In Part 1 I’m going to show you how to add and manage user accounts. Learning these features has been a critical part of efficiently managing the 10+ Linux servers.
In order to create new logins, modify or delete users, you must already be logged in as sudo user. The sudo user login is the highest level (assuming you have the root account disabled) and only certain individuals should have access to a sudo account.
Each user must belong to a primary group and for security or access purposes can belong to several secondary groups.
Options:
Options:
Options:
Example: To remove the user ‘rebecca’ and his home directory
userdel -r rebecca
Options:
Example: To change the password for the account you are currently logged in as…
Example: To change the password for the user ‘mark’ (only you are logged in as a sudo user)…
User names and primary groups are stored in /etc/passwd. This file can be directly edited using the ‘vi’ editor, although this is not recommended. Format of the file is…
Each field is separated by a colon.
Passwords for each user are stored in /etc/shadow. This file should only be changed using the passwd command.
Group information is stored in /etc/group. This file can be directly edited using the ‘vi’ editor. Format of the file is…
Each field is separated by a colon.
When a new user is created, the default files and directories that are created are stored in /etc/skel.
This directory can be modified to fit your needs. Modifications only effect new users and does not change anything for existing users.
To switch to another user, use the su command. This is most commonly used to switch to the root account.
Example: To switch to root account…
Example: To switch to the user ‘rebecca’…
su rebecca
Enter Rebecca’s or the sudoer’s passwd
To return to original user, enter exit
Well there you go. In Part 2 I’m going to go over how to add users for the web folders including FTP users that are limited to their home folder.
This entry was posted on Friday, August 22nd, 2008 at 5:14 pm and is filed under Linux. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
Title : My Boy (1)
Media: Canon EOS 350D DSLR, Adobe Lightroom, Photoshop
Description : A day out in the park with my world.
Title : Tasmania Corrective Services Badge
Media: Adobe Illustrator, Stitch
Description : Badge for the Canine Drug Detection Unit
Title : Webb Martin Consulting Website Concept 1
Media: Blog/Website, flash, css, xhtml, php
Description : Website deisgn for Webb Martin Consulting
Title : Webb Martin Website Design Concept
Media: Wordpress, CSS, xhtml, php
Description : Concept website design for Webb Martin.