1.Ubuntu操作

# 安装ssh
sudo apt-get install openssh-server

备份 sshd_config 配置文件
sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak

# 编辑 sshd_config 内容:
Port 23 # 端口改为23,22端口已被占用
ListenAddress 0.0.0.0 # 取消注释
#StrictModes yes # 注释
PasswordAuthentication yes # 允许密码登录
PermitRootLogin yes # 允许使用root登录

# 启动 ssh
sudo service ssh start

# 如果提示sshd error: could not load host key,则用下面的命令重新生成
sudo rm /etc/ssh/ssh*key
dpkg-reconfigure openssh-server

# 再次启动 ssh
sudo service ssh start

2.使用Xshell链接

image.png

image.png

连上了!

你可能感兴趣的文章