One. Manually create the file:
1. Change/etc/passwd file
2. Change/etc/shadow
3. Change/etc/group file
4.mkdir/xiaoming
5.cp/etc/skel/.bash*/xiaoming/
6.chown-r Xiao
(1)./etc/passwd file Detailed
Root x 0 0 Root/root/bin/bash
User name password user identification Number group identification number annotative Description home directory Login Shell
(2)./etc/shadow file
Xiaoqiang $6$r0y8zmjd$nl7auog7kd5y10/0veqg0ed2w5tlfviucx/qhrkji2wfhqzjjrfigxcmiduridmoj.srkng//q59tpblnj8og. 17385
Account name Password if the first character in the password bar is ' * ' or '! ' means that the account will not be used to log in. The date of the last password change is counted as the number of days
0 99999 7: :
Number of days password cannot be changed the number of days the password is subject to change expires the expiration date of the account: this date is the same as the third field.
Xiaoqiang:$6$r0y8zmjd$nl7auog7kd5y10/0veqg0ed2w5tlfviucx/qhrkji2wfhqzjjrfigxcmiduridmoj.srkng//q59tpblnj8og. : 17385:0:99999:7:::
(3). cat/etc/group|tail-1
Xiaoqiang x 500:
User group X is a password segment that indicates that no password is set this group of GID is 500, and this group is for that few users of the affiliate group
(4) Specific steps
1./ETC/PASSWD Line Join
Xiaoming:x:502:501::/home/xiaoming:/bin/bash
2./etc/shadow Line Join
Xiaoming:$6$r0y8zmjd$nl7auog7kd5y10/0veqg0ed2w5tlfviucx/qhrkji2wfhqzjjrfigxcmiduridmoj.srkng//q59tpblnj8og. : 17385:0:99999:7:::
3./etc/group
group1:x:501:
You can add a new row and specify the user's group IP, or you can specify it in the passwd, which is not built.
4. mkdir/home/xiaoming
5. Su-xiaoming the user does not have an environment variable at this time.
Password:
-bash-4.1$
6.cp/etc/skel/.bash*/home/xiaoming/Add environment variables to the user directory.
Su-xiaoming
[[Email protected] ~]$ environment variable appears.
7. mkdir AAI Create a directory at this point, the user does not have any permissions, although it exists.
Mkdir:cannot Create directory ' AAI ': Permission denied
8. The Chown-r xiaoming:group1/home/xiaoming (-r parameter is recursive meaning, which is for all directories under/home/xiaoming to modify permissions. )
9. mkdir AA You can create a directory now.
[Email protected] ~]$ ls-l
Total 4
Drwxr-xr-x 2 xiaoming group1 4096 7 14:51 AA
ll/etc/passwd
-rw-r--r--1 root root 1670 7 14:33/etc/passwd
LL Aa1
-rw-r--r--1 xiaoming group1 0 7 14:57 Aa1
This article is from the "Linux Manual Creation user" blog, so be sure to keep this source http://13179370.blog.51cto.com/13169370/1954213
Manually create a user's explanation under Linux