ubuntu开启ssh连接

1.安装openssh-server

sudo apt-get install -y openssh-server

2.修改/etc/ssh/sshd-config配置

PermitRootLogin no修改为yes
PubkeyAuthentication yes修改为no
AuthorizedKeysFile .ssh/authorized_keys 去掉注释
PasswordAuthentication no修改为yes

3.开启防火墙的22端口

ufw allow 22/tcp
原文地址:https://www.cnblogs.com/tiger2soft/p/5771405.html