
Root can do anything, so a mistake of yours, or a program’s, can wipe everything. The normal practice is to create an ordinary user and give it the right to ask for administrator powers only when needed, with the sudo command. It takes five minutes and is one of the six basic precautions in keeping your VPS secure. The commands are for your own server and run as root; support does not run them for you (see how far our support goes).
Step by step
|
|
|
|
|
| I want to… | Command |
| See a user’s groups | groups maria |
| Change their password | sudo passwd maria |
| Lock the password without deleting the account | sudo passwd -l maria (sign-in by SSH key stays possible; to cut it, remove the key from the authorized_keys file) |
| Delete the user and the home folder | sudo userdel -r maria (on Debian and Ubuntu also deluser --remove-home maria) |
| Become root from the user | sudo -i |
| Test sudo before you block root. If the user is not in the right group, sudo says it has no permission and you are left with no way to manage the server. Keep the first session open until you confirm sudo works. If you still end up locked out, the route is the console: see I have lost SSH access to my server. |
| One user per person. Instead of sharing one, create one each, to know who did what and to remove one person’s access without affecting the others. Each one’s files and permissions are in Linux file permissions on a VPS. And never make sudo password-free for everyone out of convenience. |
|
Lost access after changing users or SSH? Tell us what you did and the VPS address. Open a support ticket |
RECOMMENDED PRODUCT VPS server with root access Resources of your own, the OS you choose, reinstall whenever you like. from 7.560,00 Kz/mo (3-year plan, with coupon) See plans |
- 0 Users Found This Useful











