sshd问题:A protocol error occurred. Change of username or service not allowed

在securecrt远程工具中,使用roto登陆的时候,出现了

The server has disconnected with an 
error.  Server message reads: A protocol error occurred. Change of 
username or service not allowed: (shang1,ssh-connection) -> 
(shang,ssh-connection)

这是因为sshd中禁用了root账户远程登录。

修改sshd配置文件:

vim /etc/ssh/sshd_config

把 PermitRootLogin no

改为 PermitRootLogin  yes

root账户即可远程登录。


或者在本地用root账户创建一个新的账户,如

useradd  user1

passwd user1

然后给一个sudo权限

vim  /etc/sudoers

找到   root    ALL=(ALL)       ALL

直接复制这一行,修改root为user1,粘贴到这行下边,all是不限定权限。

user1    ALL=(ALL)       ALL

使用user1 远程登录,然后sudo su - ,输入密码即可使用root权限。

本文出自 “Study” 博客,请务必保留此出处http://wxpan.blog.51cto.com/4861826/1677103

文章来自:http://wxpan.blog.51cto.com/4861826/1677103
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3