By default Ubuntu will not allow root login. You will have to either login to privileged user and then use the sudo command or you can use to sudo su to run as root.
Note: Its never a good idea to run as root.
- The Ubuntu machine already as user ‘Student” which sudo privileges.
Step 1: Set password for the root.
$ sudo passwd
Step 2: GDM configuration file need to be modified to allow root login. the file is located at /etc/gdm3/custom.conf. Add the line AllowRoot=true in the file.
Step 3: Allow the root user to login via GUI.
previous steps allow the root user to login, but it does not allow the root user to login via GUI. the feature is disabled in the configuration file. Comment the line in the file /etc/pam.d/gdm-password that disabled root login via GUI and then we should be able to login as root via Login prompt.
Step 4: Finally restart the Ubuntu and should be able to login as root via GUI.
Step 5: Click on not listed.
Step 6: Enter the root as username and password which was set in set 1.
With great power comes great responsibility. Use the root users wisely.
資料來源:https://medium.com/@karthiked/enable-root-login-in-ubuntu-ubuntu-22-04-70521607bc7c
沒有留言:
張貼留言