Create and delete subusers on Linux server in XShell

Create and delete subusers on Linux server in XShell

1. Create sub-users

Note:Only the root user can create sub-users

  • step:

    1. First open XShell and log in as the root user, then enteruseradd 要添加的用户名(自己取名字)

    2. Then set a password for this username and enterpasswd 用户名

  • Log in as sub-user:

    1. Open a new XShell window, log in as the root account, enterssh 用户名@ip:hereip and the root user Theipsame.

    2. 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:

    1. First open XShell and log in as the root user, then enteruserdel 要删除的用户名. Note:The sub-user to be deleted must log out before deleting.

    2. 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, useuserdel -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.

Guess you like

Origin blog.csdn.net/qq_44121078/article/details/133752275