By default, Ubuntu 14.04 does not permit the root user to log in through SSH for security reasons. However, there might be situations where you need to enable SSH access for the root user. In this guide, we will show you how to allow the root user to use SSH on Ubuntu 14.04. Please note that this action may expose your system to potential security risks, and it is recommended to use a non-root user with sudo privileges for most administrative tasks.
Step 1: Backup the SSH configuration file
Before making any changes to the SSH configuration, create a backup of the current configuration file:
sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.backup
Step 2: Edit the SSH configuration file
Open the SSH configuration file with a text editor, such as nano:
sudo nano /etc/ssh/sshd_config
Find the following line:
#PermitRootLogin without-password
Uncomment this line by removing the “#” at the beginning, and change “without-password” to “yes”:
PermitRootLogin yes
Save and close the file.
Step 3: Restart the SSH service
Apply the changes by restarting the SSH service:
sudo service ssh restart
The root user should now be able to log in via SSH using the root password.
root@ubuntu14:~# service sshd restart ssh stop/waiting ssh start/running, process 1499 root@ubuntu14:~#
Programs Mentioned:
- SSH (Secure Shell) – A cryptographic network protocol for operating network services securely over an unsecured network, commonly used for remote command-line login and remote command execution.
- sshd_config – The main configuration file for the OpenSSH server, which contains various settings that control the server’s behavior and security features.
Conclusion
By following this guide, you have successfully enabled SSH access for the root user on Ubuntu 14.04. Please be aware that allowing root access via SSH can be a security risk, and it is generally recommended to use a non-root user with sudo privileges instead. Always ensure that you use strong, unique passwords for all user accounts and keep your system up-to-date with security patches.
If you have any questions, comments, or suggestions for improvements, please feel free to share your thoughts. Your feedback helps us provide the most accurate and useful information possible.
3 Comments
I’m sorry , but this obvious method doesn’t work.
No way to login as root from putty or other ssh client
Clearly you are a dumb-ass then because it does and there is
Ubuntu 14.04 has ssh bug, it may still failed to allow root login by simply run “service ssh restart”. But reboot the OS will make it work. Saying others dumb-ass is not polite even if you are the most smart in the universe.