Managing a server on a robust platform like ava.hosting often requires administrative access, but Ubuntu disables root login via SSH by default for security. In scenarios where root access is essential—such as deploying critical updates or configuring system settings—enabling root SSH login can streamline your workflow. This guide walks you through securely enabling root login on an ava.hosting Ubuntu server, balancing convenience with safety to keep your VPS or shared hosting environment secure.
Before enabling root login, ensure that you have root access. You can switch to the root user with:
sudo -iIf you haven’t set a root password yet, you can create one using:
sudo passwd rootEnter and confirm the new root password.
To allow root login via SSH, you need to modify the SSH configuration file.
sudo nano /etc/ssh/sshd_configPermitRootLogin prohibit-passwordPermitRootLogin yesApply the changes by restarting the SSH service:
sudo systemctl restart sshIf you have UFW (Uncomplicated Firewall) enabled, allow SSH traffic:
sudo ufw allow ssh
sudo ufw reloadNow, try logging in as root from another system using:
ssh root@your-server-ipEnter the root password when prompted.
For security reasons, consider restricting root login by allowing only specific IPs. Edit the SSH configuration file again:
sudo nano /etc/ssh/sshd_configAdd the following line:
AllowUsers root@your-trusted-ipSave the file and restart SSH:
sudo systemctl restart sshEnabling root SSH login on an Ubuntu server hosted by ava.hosting simplifies administrative tasks, but it must be done with care. By following these steps, you can securely enable root access while leveraging ava.hosting’s reliable infrastructure. For example, you might enable root login to install a software package like nginx directly or troubleshoot a critical service outage. To minimize risks, use SSH key authentication and restrict access to trusted IPs. With these precautions, you can manage your ava.hosting server confidently, ensuring both efficiency and security.