Ubuntu enables root login and remote login

1. Enable root user login

1. Set root password

sudo passwd root

Set the root account password after verifying the current account password

2. Switch command line to root

su - root

3. Annotate the following file content

vim /etc/pam.d/gdm-autologin

#auth required pam_succeed_if.so user != root quiet_succes

vim /etc/pam.d/gdm-password

# auth required pam_succeed_if.so user != root quiet_success

4. After restarting the computer, you can log in with the root user

 

Two, configure remote login

1. Check the openssh-server service

2. Install ssh service: apt-get install openssh-server

3. Modify the ssh configuration file

vi /etc/ssh/sshd_config

Port 22 #Uncomment this line

LoginGraceTime 2m # uncomment this line

PermitRootLogin yes #Uncomment this line and change prohibit-password to yes

StrictModes yes # uncomment this line

MaxAuthTries 6 #Uncomment this line

MaxSessions 10 # uncomment this line

3. Start or restart the service

systemctl restart ssh

systemctl enable ssh

4. After the configuration is complete, you can use the tool for remote connection.

 

 

Guess you like

Origin blog.csdn.net/weixin_45198978/article/details/129172655