Linux learning user and group commands

  
        

User and Group Commands

Adding a new user: Useradd

Example: useradd + username

FAQ:

Using a non-root user Can not use this function, log in as root, or get root privileges + environment variables.

How to get root privileges: su -, and enter the password;

Can't use su alone, su value to get permission, no environment variable

1.Every added A user, the system automatically creates a new file under /home

After entering home, you can change the password by command:passwd +username.

The passwd file under 2./ect will be changed to write new user information.

Delete User: Userdel

1.Userdel + Username, delete only users, delete files under /home

2. Continue to delete files with rm

Change user information: Usermod

Example: Change user group: usermod–g new group to change

New group: groupadd

in /ect The group file can be seen in the group below, and the group information is stored.

When adding a user without a group parameter, a group with the same username is added by default.

User Switching

Su(switch user) + Switching to user; exit exiting

When a new user logs in, the default current directory is the user's home directory

Supplement

User Shell

Shell is a layer outside the kernel that is responsible for user commands and dealing with the kernel.

Shells come in different forms, such as Cshell, and many commands are executed differently in different shells.

Bash=Bshell->B –Again –Shell; or have Cshell, ksh, sh, etc.

Copyright © Windows knowledge All Rights Reserved