帮助中心

这里有最新的使用文档和教程

< 返回

Ubuntu系统root用户远程登录

2023-07-14 16:51 作者:31IDC 阅读量:1792 所属分类:Linux系统

Ubuntu系统root用户远程登录 

通过CRT远程登录Ubuntu时遇到报错:

The client has disconnected from the server.  Reason:

 

Unable to authenticate using any of the configured authentication methods.  

 

Ubuntu初始登录只能是普通用户,想用root登录,需普通用户登录,然后切换为root用户,先设置root密码,再更改sshd_config文件

 

ixo@snort:~$ sudo su

Password: 

root@snort:/home/ixo#sudo passwd root

New password: 

Retype new password: 

passwd: password updated successfully

root@snort:/home/ivo# nano /etc/ssh/sshd_config

 

注意:是sshd_config,而不是ssh_config

 

...

#port 22

port 22

#PermitRootLogin prohibit-password

PermitRootLogin yes    # 允许root直接登录

 

保存后重启ssh服务

 

sudo service ssh restart

 

31IDC - 12 年深耕海外 IDC 高端资源