6 Linux user and user group management

Linux system is a multi-user multi-task time-sharing operating system, any user to use the system resources are required to apply for the Prime Minister as a system administrator account, and then enter the system with the account identity

Each user account has a unique user name and password each

After the user types the correct user name and password at the time of landing, and the system will be able to enter their home directory

Implement user account management:

1. Add user accounts, delete, modify,

2. User password management

3. The user group management

 

Linux user account management system

Add user account management involves user accounts, modify, and delete

Add user accounts is to create a new account in the system, and then assign users to a new account number, user group, home directory and landed Shell and other resources, just add the account is locked, you can not use

1. Add a new user account

useradd Options Username

-c: commnet description designated a comment

-d: directory specified user's home directory, if this directory does not exist, create a home directory using -m

-g: Specifies the user group the user belongs to a user group

-G: user groups, user groups, specify additional groups the user belongs

-s: Shell Shell file specified user login

-u: Specifies the user's user number user number, if there are -o option is repeated using a different user identification number

2. Delete the account:

userdel username Options

-r: the deleted along with the user's home directory

3. Modify Account:

usermod options Username

Useradd parameter reference

4. User password management:

passwd username option

-l: Lock password, the account is disabled

-u: password unlock

-d: is the account without a password

-f: force the user to change the password the next time you log in

 

Linux system user management:

Each user has a user group, the system can be centrally managed for all users in a user group, Linux systems are different for different user groups specified

User group management involves additions and deletions to the user group, it is actually an update to / etc / group file

1. Add a new user group

groupadd options User Group

-g GID new group ID specified user group (GID)

-o: generally used with -g, GID represents the new group may be the same user group existing system GID

2. Delete an existing user group

groupdel User Group

3. Modify the properties of a user group

groupmod options User Group

-g GID Specifies the new group ID for the user organization

-o -g and simultaneously, a new GID user group may be the same GID system existing user groups

-n: the name of the new user group user group to a new name

4. If a user belongs to a plurality of user groups, the user can switch between user groups, to other users in order to have groups

$ Newgrp root switch to other user groups, parameters: the target user group

Prerequisite: The target group of users is really the main group or additional groups that the user is similar to user account management

Can also be done through the integrated system management tools

 

Associated with the user account system files

Complete user management jobs there are many ways, but each method are actually related to system files to be modified

1./etc/passwd file is the most important document related to user management

eg:

root:x:0:0:Superuser:/:

daemon:x:1:1:System daemons:/etc:

bin:x:2:2:Owner of system commands:/bin:

sys:x:3:3:Owner of system files:/usr/sys:

adm:x:4:4:System accounting:/usr/adm:

uucp:x:5:5:UUCP administrator:/usr/lib/uucp:

auth:x:7:21:Authentication administrator:/tcb/files/auth:

cron:x:9:16:Cron daemon:/usr/spool/cron:

listen:x:37:4:Network daemon:/usr/net/nls:

lp:x:71:18:Printer administrator:/usr/spool/lp:

I: x: 200: 50: I dream: / usr / I: / bin / sh

 

Username: Password: users said Number: Group expressed its number: Comment description: Home Directory: Login Shell

 

1. User name: String behalf of the user account

2. Password: some systems, the storage of user passwords encrypted

3. User identification number: an integer, with his internal system to identify the user

4. Group ID: field of a record is a user group the user belongs

The description Note: some personal record of the user

6. The home directory: the user's home directory working

7. After user login, to start a process, the user is responsible for the operation passed to the kernel, this process is to login to your command interpreter or a particular program to run after the system, Shell

8. The system has a user class of the user called false

bin: executable user has a command file

sys: system files have

adm: have an account file

uucp: uucp use

lp: lp or lpd subsystem

nobody: NFS use

 

Guess you like

Origin www.cnblogs.com/heixiang/p/10983863.html
Recommended