Using SSH over Ethernet as Root Account
After the new system is installed, the rejected connection denial appears when you try to
log on to the Ubuntu Linux server as a root user. Here is the example
information:
$ ssh root@192.168.120.41 ssh: connect to host 192.168.120.41 port 22: Connection refused
To enable SSH root login, perform the following steps:
- Run the following command to configure the SSH
server:
echo 'PermitRootLogin=yes' | sudo tee -a /etc/ssh/sshd_config - Restart the SSH
server:
sudo systemctl restart ssh.service
Result:You will be able to use SSH login using the root account. The following output indicates the login is successful:
Example Output:
$ ssh root@192.168.120.79 The authenticity of host '192.168.120.79 (192.168.120.79)' can't be established. ECDSA key fingerprint is SHA256:WhxBNiLBOS3J0IzNyBBuOeoNDRVqVQXfxC4MjZ7tbbo. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.120.79' (ECDSA) to the list of known hosts. root@192.168.120.79's password: Welcome to Ubuntu 24.04.3 LTS (GNU/Linux 6.12.5-starfive riscv64) * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/pro System information as of Wed Oct 15 06:46:40 UTC 2025 System load: 3.19 Temperature: 49.4 C Usage of /: 9.0% of 51.15GB Processes: 226 Memory usage: 13% Users logged in: 1 Swap usage: 0% IPv4 address for eth0: 192.168.120.79 Expanded Security Maintenance for Applications is not enabled. 23 updates can be applied immediately. 16 of these updates are standard security updates. To see these additional updates run: apt list --upgradable Enable ESM Apps to receive additional future security updates. See https://ubuntu.com/esm or run: sudo pro status The list of available updates is more than a week old. To check for new updates run: sudo apt update root@starfive:~# - Login as root account using SSH as described in Using SSH over Ethernet.
