📢 LordCloud support has moved to Ballastra — Join now →
Docs

Root access

Use root safely — create a sudo user, understand sudo, and avoid working as root day to day.

1 min read Some details need confirmation
On this page

Root can do anything — including break the system with one typo. Use a normal user with sudo for daily work.

Create a sudo user (Ubuntu/Debian)#

bash
adduser deploy
usermod -aG sudo deploy

Copy your SSH key to the new user:

bash
rsync --archive --chown=deploy:deploy ~/.ssh /home/deploy

Test in a new terminal before logging out of root:

bash
ssh deploy@YOUR_SERVER_IP
sudo whoami   # should print: root

Using sudo#

Prefix admin commands with sudo:

bash
sudo apt update
sudo systemctl restart nginx

Lost access?#

If you lock yourself out (a lost key, or a firewall that blocks SSH), you'll need out-of-band console access or a reinstall.

Once you've confirmed the new user works, disable root SSH login.

Have a question? Chat with us👋