Ubuntu配置ssh服务并使用密码连接xshell

168 阅读1分钟

1.安装ssh

sudo apt install openssh-client
sudo apt install openssh-server

如果安装失败,尝试sudo apt install ssh

2.启动ssh并确认ssh的状态

sudo service ssh start
sudo service ssh status

3.配置ssh的文件,并重启

sudo vim /etc/ssh/sshd_config

  • 打开port端口,默认是22,可以自行修改
  • PasswordAuthentication 去掉注释并改为yes
  • root账户默认都是使用RSA登录,如果想要使用密码,将PermitRootLogin prohibit-password 改为: PermitRootLogin yes

image.png image.png

image.png

重启ssh服务: sudo service ssh restart

4. 连接xshell

image.png image.png