Article Title: Add a user manually. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
To extract the document from laruence, try to add a user without using useradd:
As follows:
Create the required group (vi/etc/group) first)
Create attributes of an account (vi/etc/passwd)
Synchronize passwd and shadow (pwconv)
Create a password for this account (passwd acount)
Create a user's home directory (cp-r/etc/skel/home/account)
6. Change the home Directory attributes (chown-R account. group/home/account)
Create a new group named test and set its GID to 520.
[Root @ test/root] # vi/etc/group
---- Omitted
Test: x: 520: test <= adds a group. The group is named test and the GID is 520.
Create attributes of test
[Root @ test/root] # vi/etc/passwd
---- Omitted
Test: x: 520: 520: testing account:/home/test:/bin/bash <= create attributes
Synchronize/etc/passwd and/etc/shadow
Create a new group named test and set its GID to 520.
[Root @ test/root] # vi/etc/group
---- Omitted
Test: x: 520: test <= adds a group. The group is named test and the GID is 520.
Create attributes of test
[Root @ test/root] # vi/etc/passwd
---- Omitted
Test: x: 520: 520: testing account:/home/test:/bin/bash <= create attributes
Synchronize/etc/passwd and/etc/shadow
[Root @ test/root] # pwconv <= Transfer passwd data to/etc/shadow!
Create Password
[Root @ test/root] # passwd test <= create the user test Password
Changing password for user test
New password:
Retype new password:
Passwd: all authentication tokens updated successfully
Create a home directory and convert the owner of the home directory
[Root @ test/root] # cp-r/etc/skel/home/test
[Root @ test/root] # chown-R test: test/home/test
OK.