Hot Article
- Centos7 closes and restarts the system firewall and opens firewall ports
- How IID server uses Xshell to connect to Linux (centos) server
- BT panel forgets the background login URL, and the solution to the security entrance verification failure
- What to do if a cp: omitting directory error occurs in Linux (detailed solution)
- The php domain name points to ip, how to use the specified ip address to access a server in the url request domain name in curl mode
- Error connecting to MySQL: Cant connect to MySQL server (10060)
IDGlobal teaches you how to set up root remote login in Ubuntu SSH
- Author:Ke
- Category:Server Maintain
- Release Time:2022-11-29
Ubuntu system does not set a password for root by default, and does not enable SSH login. How do we enable root login? The following IDGlobal server merchants will introduce to you how
sudo passwd root After the execution, set a password for root, and it will ask you to enter the password of the current user for verification. Non-administrator users need to add sudo
su – root to switch to the root account, and enter the above settings root password
vi /etc/ssh/sshd_config edit sshd_config file
press i or press o or press a< /strong> Or press R to enter edit mode
found
PermitRootLogin without-password
or
PermitRootLogin prohibit-password
Comment out
#PermitRootLogin without-password
or#PermitRootLogin prohibit-password
Or just delete
Some system versions are commented out by default, just add another line
Adding PermitRootLogin yes
is to allow SSH remote login
Press and hold ctrl+C
or press esc to exit the editing mode
Then press shift+: it means input in the last line:
Input wq! Force to save and exit
Restart the SSH service to take effect: service ssh restart
related topic
- centos7 open and close 80 port tutorial
- Centos7 closes and restarts the system firewall and opens firewall ports
- How to modify the remote port in CentOS 7 and 8
- How to solve the Windows 10 prompt "The built-in administrator cannot activate this application"?
- How to view file size in linux
- How To Install Plesk Panel on Ubuntu 20.04 Server?