Article directory
Create and delete subusers on Linux server in XShell
1. Create sub-users
Note:Only the root user can create sub-users
-
step:
-
First open XShell and log in as the root user, then enter
useradd 要添加的用户名(自己取名字)
-
Then set a password for this username and enter
passwd 用户名
-
-
Log in as sub-user:
-
Open a new XShell window, log in as the root account, enter
ssh 用户名@ip
:hereip
and the root user Theip
same. -
Now you can perform some operations under this user, but the permissions are definitely not as good as the root user.
-
2. Delete sub-users
-
step:
-
First open XShell and log in as the root user, then enter
userdel 要删除的用户名
. Note:The sub-user to be deleted must log out before deleting. -
Now this user cannot log in (ssh user authentication will keep popping up after entering the password).
-
If you also want to delete the files it leaves on the system, use
userdel -r 用户名
. (-r: Recursively delete all files of this user)
OKOK, that’s it for this sharing. For an introduction to Linux, you can read another blog on my homepage.