How To Add and Delete Users on a CentOS 7 Server
How To Add and Delete Users on a CentOS 7 Server
If you are new to managing a CentOS 7 server, you may need to add or delete users at some point. In this tutorial, we will guide you through the process of adding and deleting users on a CentOS 7 server.
Adding a User
To add a new user on your CentOS 7 server, follow these steps:
- Log in to your server as root or a user with sudo privileges.
- Open the terminal and type the following command:
adduser newusername(Replace "newusername" with the username you want to create). - Press Enter and set a password for the new user when prompted.
- Follow the on-screen instructions to provide additional information about the user, such as their full name and phone number.
- Once you have provided all the required information, press Enter to create the user.
- You can now log in to your server using the new username and password.
Deleting a User
To delete a user from your CentOS 7 server, follow these steps:
- Log in to your server as root or a user with sudo privileges.
- Open the terminal and type the following command:
userdel -r username(Replace "username" with the name of the user you want to delete). - Press Enter and confirm that you want to delete the user by typing "yes" when prompted.
- The user and their home directory will be deleted from your server.
Congratulations! You now know how to add and delete users on a CentOS 7 server.
Keywords: CentOS 7, server, add user, delete user, tutorial.
Комментарии
Отправить комментарий