xshell登录windows10 子系统

修改端口

cd /etc/ssh

备份

sudo cp sshd_config sshd_config.bak
sudo vim sshd_config

修改sshd_config

Port 2233  #修改端口
ListenAddress 0.0.0.0  #打开本地监听
#StrictModes yes  #注释掉
PasswordAuthentication yes  #允许密码登陆1234

重启ssh

sudo service ssh restart1

重新生成host key

sudo dpkg-reconfigure openssh-server1

完成

Copyright © 2015-2026