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
- 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)
- How to purchase a dedicated server
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
- What should I do if the cloud storage space is full (solutions for clearing the cloud storage space)
- How to block foreign IP access on Linux server?
- How to restart the Redis service command
- How does CentOS7 open/view ports?
- IDGlobal teaches you to disable ICMP protocol on CentOS
- CentOS uses SpeedTest to measure speed