在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權限。