wsl에 ubuntu를 처음 설치한 후에는 sshd 가 정상 동작하지 않는 것 같다. telnet 으로 접속하려 할 때 접속이 되지 않는다.
이를 해결하려면 openssh 를 아래와 같이 설치하면 된다.
sudo apt update sudo apt upgrade sudo apt purge openssh-server sudo apt install openssh-server
설치 후 /etc/ssh/sshd_config 파일을 열고 아래 내용을 찾아 코멘트 처리를 해제한다.
Port 22 Protocol 2 PermitRootLogin no AuthorizedKeysFile .ssh/authorized_keys PasswordAuthentication yes PubkeyAuthentication yes ChallengeResponseAuthentication no X11Forwarding yes UseDNS no
이제 ssh server를 재시작한다. 조금이라도 문제의 소지를 없애기 위하여 확실하게 재기동을 하게 한다.
sudo service ssh --full-restart sudo service ssh restart