Disable Root Login for Better VPS Security
Allowing direct root login via SSH is risky and makes your VPS vulnerable to brute-force attacks. It’s recommended to disable root login and use a regular user with sudo privileges.
Step 1: Create a New User
sudo adduser newuser
sudo usermod -aG sudo newuser
Step 2: Login with New User
ssh newuser@your-server-ip
Step 3: Disable Root Login
Edit the SSH configuration file:
sudo nano /etc/ssh/sshd_config
Find the line:
PermitRootLogin yes
Change it to:
PermitRootLogin no
Step 4: Restart SSH Service
sudo systemctl restart ssh
✅ Now root login is disabled, and only your new user can log in with SSH, making your VPS more secure.
