Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Linux Learning Notes: Users and Groups     - The direct insertion sort algorithm (Programming)

- Java input and output common class Scanner (Programming)

- Linux install deploy Ansible (Linux)

- Database Blob data type conversion String (Programming)

- Linux / UNIX: Use the dd command to create a 1GB size binary (Linux)

- Process safety monitoring and protection under the Linux operating system (Linux)

- Ant command-line compiler Android project (Programming)

- How to update the Linux kernel to improve system performance (Linux)

- MySQL Data Types (Database)

- Java data structures - order linear form of table ArrayList (Programming)

- Install minimize RHEL / CentOS 7 some things need to do (Linux)

- Linux System Getting Started Learning: install software packages on Ubuntu and Fedora (Linux)

- Linux pwd command learning experience (Linux)

- Zabbix installation and configuration process (Server)

- awk pattern matching (Programming)

- OpenJDK7 source compiler installation on CentOS 6.5 (Linux)

- 2016, the new Node project Precautions (Programming)

- OpenSUSE GPG Comments (Linux)

- Oracle in the add & split partition on the impact of global & local index (Database)

- How to use awk command in Linux (Linux)

 
         
  Linux Learning Notes: Users and Groups
     
  Add Date : 2018-11-21      
         
         
         
  Linux Learning Notes: Users and Groups

First, what is the users and user groups

User: the person using the operating system

User groups: a group of users with the same system privileges

Second, associated with the user and group profiles

Information / etc / group to store the current system, all user groups

Format: Group Name: Password placeholder group: Group ID: Username list group

Note: (1) user password, natural user group has its own password.
(2) If the group has only one user and user group with the same name and then a list of users in a group can be omitted. Thus, in
Profiles can see a lot of users in the group list is empty, it may not really empty.
(3) root user group number must be 0
(4) group number from 1 to 499 belonging to the group numbering system reserved. It is generally reserved for the software installed on the operating system or
Services, such as you install MYSQL, it will have a group number.
User group number (5) user manually created for the 500 ~.
(6) group password placeholder with X all represented.

/ Etc / gshadow current password information storage system user group

Format: Group name: Group Password: Group manager: group user list

Note: (1) group password is empty or is * or is! , It can be considered the group password is empty.

(2) group general manager is empty, which means that all users of the group can manage the user groups

Information / etc / passwd to store the current system, all user groups

Format: Username: Password placeholders: User ID: User Group ID: User comment information: the user's home directory: shell type

Note: (1) user comment information that is created when a user can add some comments to this user information.

(2) the user's home directory, that user root out other user's time will create in your home directory

Create a user in the same directory as their name used to store the user's personal files directory.

(3) the superuser root user ID is necessarily 0

All the user's password information / etc / shadow to store the current system

Format: Username: Password :::::

Note: The password is encrypted in general, you can not see the real password.

Third, the basic commands of users and user groups

 groupadd group name // Add User Group
groupadd -g group number Group name // add user groups and assign group number
 groupmod -n new group name of the original group name // Change a group name
 groupmod -g group number Group name // change the user group number
 groupdel group name // delete a user group

useradd username // add a user, where the user group and user names with the same name
useradd -g group username // add a user name, specify it in the group
useradd -d directory username // add users to develop their user's home directory, where the group not specified, the default user name for the user group name
usermod -c Note User Name // add comments to specify a username
usermod -l new user name old username // change the user name
usermod -d directory path to the user to change the user name // Personal Folders
usermod -g new user username // Change the specified user group belongs
userdel username // delete a user, but does not delete the user's personal folder file
userdel -r username // delete users and delete users' personal folder file

Fourth, advanced users and groups command

passwd -l username // lock the user
passwd -u username // Unlock
passwd -d username // clear the password, the user can log in without a password
gpasswd -a username affiliated group // add to the user group subsidiary
gpasswd -d username affiliated group // delete the user from the affiliated group
// newgrp group name of the user group to switch to the affiliated group
useradd -g group1 -G group2, group3 ... // specify the main user groups and affiliated groups
gpasswd username // change the group password, enter the appropriate instructions will be

id username // Display the user information, including user ID, user ID, group number and the name of the main sub group list
su username // switch to other users under
su behind nothing // then switch to the root user represents
whoami // display the currently logged on user name
groups Username // display all the user's groups, including the main group and subsidiary groups
     
         
         
         
  More:      
 
- Oracle metadata Reconstruction experiments (Database)
- Findbugs installation documentation (Linux)
- How to Install Telegram instant messaging software on Ubuntu (Linux)
- To share Linux script automatically change passwords (Linux)
- Tomcat configuration memory and remote debug port (Server)
- MongoDB common optimization settings in Linux (Database)
- Install Firefox 32 official version of the Linux system (Linux)
- How do I upgrade to Ubuntu 15.04 (Beta) (Linux)
- How to manage start-up applications in Ubuntu (Linux)
- OpenSUSE installation on CentOS6 (GUI) (Linux)
- Understand ASP.NET 5 running the command: DNVM, DNX, and DNU (Server)
- Java Network Programming Internet address lookup (Programming)
- How to configure SNMPv3 on Ubuntu, CentOS and Cisco systems (Linux)
- Linux iptables: Composition Rules (Linux)
- Spring Data MongoDB combat (Database)
- Linux memory management -free learning experience (Linux)
- Ubuntu How to install Pacman (Linux)
- Linux kernel update error, update-initramfs: failed Solution (Linux)
- Why did not Oracle privileges can also log in with sysdba (Database)
- How to Install SeaMonkey 2.25 for Ubuntu (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.