使用ssh连接WSL
生活随笔
收集整理的這篇文章主要介紹了
使用ssh连接WSL
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
1. 前言
稍微記錄一下ssh連接WSL,雖然已經(jīng)有很多教程了,嘻嘻嘻
先說明一下基本步驟:
- 首先,由于WSL自帶的ssh部件不是很全,所以需要先刪除后重新安裝
- 之后,修改配置信息
- 最后,重啟ssh服務(wù)
全程只需要三步,挺簡單的,那么正文開始…
2. 正文
2.1 卸載重裝ssh服務(wù)
sudo apt remove openssh-server sudo apt install openssh-server2.2 修改配置信息
(1)修改SSH Server的監(jiān)聽端口,這里修改為23
sudo sed -i '/Port /c Port 23' /etc/ssh/sshd_config(2)修改SSH Server的監(jiān)聽地址
sudo sed -i '/ListenAddress 0.0.0.0/c ListenAddress 0.0.0.0' /etc/ssh/sshd_config(3)修改SSH Server允許使用用戶名密碼的方式登錄
sudo sed -i '/PasswordAuthentication /c PasswordAuthentication yes' /etc/ssh/sshd_config(4)修改SSH Server允許遠程root用戶登錄
sudo sed -i '/PermitRootLogin /c PermitRootLogin yes' /etc/ssh/sshd_config2.3 重啟ssh服務(wù)
sudo service ssh restart2.4 使用ssh登錄
ssh username@hostname -p 23在此,username為登錄的用戶名,hostname可為localhost或127.0.0.1或?qū)嶋H的ip地址。
參考鏈接:https://www.cnblogs.com/bpf-1024/p/14036720.html
總結(jié)
以上是生活随笔為你收集整理的使用ssh连接WSL的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: wsl设置c盘自动挂载到wsl中的/c/
- 下一篇: hadoop yarn配置任务优先级