Objective

The objective is to allow SSH root login on Ubuntu 18.04 Bionic Beaver Linux

Operating System and Software Versions

  • Operating System: - Ubuntu 18.04 Bionic Beaver

Requirements

Privileged access to to your Ubuntu system will be required as well as completed installation of SSH server.

Difficulty

EASY

Conventions

  • # - requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
  • $ - requires given linux commands to be executed as a regular non-privileged user

Instructions

Set Root Password

By default Ubuntu 18.04 Bionic Beaver installation comes with unset root password. To set root password open up terminal and execute the following linux command. When prompted enter your current user password and new root password:
$ sudo passwd
[sudo] password for linuxconfig: 
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully

Enable SSH root login

By default SSH root login is disabled. Any attempt to ssh as root user will result in the following error message:
$ ssh root@10.1.1.9
root@10.1.1.9's password: 
Permission denied, please try again.
root@10.1.1.9's password:

SUBSCRIBE TO NEWSLETTER
Subscribe to Linux Career NEWSLETTER and receive latest Linux news, jobs, career advice and tutorials.


The next command will configure SSH server to allow root ssh login:
$ sudo sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
Restart SSH server to apply changes:
$ sudo service ssh restart

SSH login as root

Your server now allows SSH login as root user. Use the password you set in the first step:
$ ssh root@10.1.1.9
root@10.1.1.9's password: 
Welcome to Ubuntu Bionic Beaver (GNU/Linux 4.13.0-25-generic x86_64)
ARE YOU LOOKING FOR A LINUX JOB?
Submit your RESUME, create a JOB ALERT or subscribe to RSS feed on LinuxCareers.com.
LINUX CAREER NEWSLETTER
Subscribe to NEWSLETTER and receive latest news, jobs, career advice and tutorials.
DO YOU NEED ADDITIONAL HELP?
Get extra help by visiting our LINUX FORUM or simply use comments below.