How to enable Root account within Ubuntu Server

Software Requirements and Conventions Used

Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Installed or upgraded Ubuntu 20.04 Focal Fossa
Software SSH
Other Privileged access to your Linux system as root or via the sudo command.
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

 

  1. Open the /etc/ssh/sshd_config file with administrative privileges and change the following line:
    FROM:
    #PermitRootLogin prohibit-password
    TO:
    PermitRootLogin yes
     

    The quick way to do this job could be just to simply use the sed command as shown below:

    $ sudo sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
     
  2. Restart SSH service:
    $ sudo systemctl restart ssh
     
  3. By default the root’s password is not set on Ubuntu 20.04 and the error message Permission denied, please try again will appear when attempting to SSH login as a root user. From this reason we need to set root’s password. When prompted enter your current user password followed by new root password:
    $ sudo passwd
    [sudo] password for linuxconfig: 
    Enter new UNIX password: 
    Retype new UNIX password: 
    passwd: password updated successfully
     
  • ubuntu, root, enable root
  • 0 A felhasználók hasznosnak találták ezt
Hasznosnak találta ezt a választ?

Kapcsolódó cikkek

how can I make sure the security is hardened for my Linux Server?

Security hardening is an important part of maintaining a secure Linux operating system. Here are...

How can i enable SSH to my linux host using ssh key?

Enabling SSH with key authentication involves generating an SSH key pair and configuring your SSH...

How to install and configure Firewalld in linux?

Firewalld is a firewall management tool that comes pre-installed on many Linux distributions....

How to install Ioncube loader on CentOS, Debian and Ubuntu

  Introduction Using ionCube encoded and secured PHP files requires a file called the...

Error: 413 Request Entity Too Large

? Error: 413 Request Entity Too Large Overview The “413 Request Entity Too Large” error occurs...