How to Enable the Root User in Ubuntu

By default, the root user in Ubuntu is disabled as no password is set. Follow these instructions to enable the root user:

  1. Set a password for the root user:

Enter the following commands in the terminal:

sudo passwd root

Then enter and confirm the new UNIX password when prompted.

  1. Restrict user access to the root account:

Enter the following commands in the terminal:

vi /etc/pam.d/su

Find the line that reads "#auth required pam_wheel.so" and change it to "auth required pam_wheel.so group=adm".

Then enter:

usermod -G adm customer

  1. Enable root login for OpenSSH:

Enter the following commands in the terminal:

vi /etc/ssh/sshd_config

Find the line that reads "#PermitRootLogin no" and change it to "PermitRootLogin yes".

Also, find the line that reads "#PasswordAuthentication no" and change it to "PasswordAuthentication yes".

  1. Restart OpenSSH:

Enter the following commands in the terminal:

/etc/init.d/ssh restart

Check the status of OpenSSH:

/etc/init.d/ssh status

Note: In the above text, red text represents input commands. "customer@ubuntu:~$" is an

  • 0 משתמשים שמצאו מאמר זה מועיל
?האם התשובה שקיבלתם הייתה מועילה