Big data combat Linux ubuntu20.04 use root user to log in to the system

After the installation of Ubuntu 20.04, there is no root account login permission by default, but we can obtain administrator permissions through the created ordinary user, then modify the configuration and the password of the root account, and finally log in to the root account. The specific operation steps are as follows.

1. Modify the 50-ubuntu.conf file

#cd /usr/share/lightdm/lightdm.conf.d/
#vi 50-ubuntu.conf
Add the following two lines at the end of the file and save
greeter-show-manual-login=true
allow-guest=false
Insert picture description here

The meaning of configuration is:
#Manually enter the username and password to log in to the system
#Guest login is not allowed (optional)

2. Modify the gdm-autologin file

#cd /etc/pam.d
#vi gdm-autologin
add # in front of the third line, comment out auth required pam_succeed_if.so user != root quiet_success, then save and exit
Insert picture description here

3. Modify the gdm-password file

#vi /etc/pam.d/gdm-password
Add # in front of the third line to comment out auth required pam_succeed_if.so user != root quiet_success, then save and exit
Insert picture description here

4. Modify the /root/.profile file

vim.tiny /root/.profile
comment out the line mesg n 2> /dev/null || true at the end of the file, and then add:
tty -s&&mesg n || true
Insert picture description here

5. Restart the system and log in as root

Guess you like

Origin blog.csdn.net/qq_45059457/article/details/109141701