演示环境:
Xshell远程连接工具
全新创建Ubuntu20.04虚拟机(没有防火墙,若有请关闭或配置防火墙规则)
1. Linux安装并开启sshd服务
#使用apt-get安装
apt-get install openssh-server
#开启sshd服务
systemctl start sshd
#查看sshd服务状态
systemctl status sshd
2. 配置sshd使其可以被远程连接root用户
vim /etc/ssh/sshd_config
#将PermitRootLogin后的内容改为 yes,并取消注释
#重启sshd服务
systemctl restart sshd
如图所示:
3. 连接
开启Xshell,点击文件->新建,输入名称和主机IP(建议配置静态IP),
点击用户身份验证,输入用户名:root,密码:root密码。方法勾选Password。
点击连接,弹出提示,选择接受并保存。
成功连接,测试如图: