连接到ssh
![图片[1]-ubuntu启用root用户ssh登陆-春枫博客](https://www.cfbk.top/wp-content/uploads/2025/04/d2b5ca33bd20250409071338-1024x565.png)
编辑/etc/ssh/sshd_config文件
sudo vim /etc/ssh/sshd_config
![图片[2]-ubuntu启用root用户ssh登陆-春枫博客](https://www.cfbk.top/wp-content/uploads/2025/04/d2b5ca33bd20250409071423.png)
输入root密码
![图片[3]-ubuntu启用root用户ssh登陆-春枫博客](https://www.cfbk.top/wp-content/uploads/2025/04/d2b5ca33bd20250409071454-1024x565.png)
直接添加一行(按‘i
’编辑)
PermitRootLogin yes
![图片[4]-ubuntu启用root用户ssh登陆-春枫博客](https://www.cfbk.top/wp-content/uploads/2025/04/d2b5ca33bd20250409071607-1024x565.png)
按“esc
键”:wq
回车
设置root用户密码
sudo passwd root
admin@cfbk:~$ sudo passwd root
New password: //输入新的密码(密码看不到)
Retype new password: //确认新的密码
passwd: password updated successfully //密码设置完成
![图片[5]-ubuntu启用root用户ssh登陆-春枫博客](https://www.cfbk.top/wp-content/uploads/2025/04/d2b5ca33bd20250409072244.png)
重启ssh服务
sudo systemctl restart ssh
![图片[6]-ubuntu启用root用户ssh登陆-春枫博客](https://www.cfbk.top/wp-content/uploads/2025/04/d2b5ca33bd20250409072347.png)
完成可以使用root连接了
© 版权声明
本文为原创作品,版权归春枫博客所有。未经允许,禁止一切形式的盗用,违者将依法追究。谢谢您的合作!
THE END
暂无评论内容