稍微记录一下ssh连接WSL,虽然已经有很多教程了,嘻嘻嘻
先说明一下基本步骤:
全程只需要三步,挺简单的,那么正文开始...
sudo apt remove openssh-server
sudo apt install openssh-server
sudo sed -i '/Port /c Port 23' /etc/ssh/sshd_config
sudo sed -i '/ListenAddress 0.0.0.0/c ListenAddress 0.0.0.0' /etc/ssh/sshd_config
sudo sed -i '/PasswordAuthentication /c PasswordAuthentication yes' /etc/ssh/sshd_config
sudo sed -i '/PermitRootLogin /c PermitRootLogin yes' /etc/ssh/sshd_config
sudo service ssh restart
ssh username@hostname -p 23
在此,username
为登录的用户名,hostname
可为localhost
或127.0.0.1
或实际的ip地址。
联系客服