sudo adduser <newuser>
Установить новый пароль:
sudo passwd <newuser>
Congratulations—you have just added a new user and their password. You can log out of the root user by typing exit and then logging back in with the new username and password.
How to Grant a User Root Privileges As mentioned earlier, you are much better off using a user with root privileges.
You can create the sudo user by opening the sudoers file with this command:
You will find the section to make the user privilege modifications at the bottom of the file. Type “a” to start inserting text. Adding the user’s name and the same permissions as root under the the user privilege specification will grant them the sudo privileges.
## Allow root to run any commands anywhere root ALL=(ALL) ALL newuser ALL=(ALL) ALL
Save and Exit the file by press “shift” ZZ. How to Delete a User Should you find that you find that you no longer want to have a specific user on the virtual private server you can delete them with a single command.
sudo userdel newuser
You can add the flag “-r” to the command if you would like to simultaneously remove the users’s home directory and files.
sudo userdel -r newuser
Смена домашней директории
usermod -d /home/john john