DevOps/WSL2

WSL2 - SSH 설정 및 접속

yscho03 2022. 5. 30. 09:08
728x90
반응형

SSH 설정 및 접속

1. 호스트 키 설정

ssh-keygen -A 명령으로 호스트 키가 /etc/ssh 경로에 생성되도록 한다.

admin@LAPTOP-O7OIHPIJ:~$ sudo /etc/init.d/ssh stop
 * Stopping OpenBSD Secure Shell server sshd                                                                     [ OK ]
admin@LAPTOP-O7OIHPIJ:~$ sudo ssh-keygen -A

2. ssh-config 설정

admin@LAPTOP-O7OIHPIJ:~$ sudo vi /etc/ssh/sshd_config
 …
# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication yes
…
admin@LAPTOP-O7OIHPIJ:~$ sudo /etc/init.d/ssh start

3. 콘솔창에서 접속

C:\>ssh admin@localhost
admin@localhost's password:
Welcome to Ubuntu 20.04 LTS (GNU/Linux 5.10.16.3-microsoft-standard-WSL2 x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Mon May 30 09:06:25 KST 2022

  System load:  0.1                Processes:             8
  Usage of /:   4.4% of 250.98GB   Users logged in:       0
  Memory usage: 0%                 IPv4 address for eth0: 172.25.67.211
  Swap usage:   0%


294 updates can be installed immediately.
179 of these updates are security updates.
To see these additional updates run: apt list --upgradable


Last login: Sun May 29 23:14:31 2022 from 127.0.0.1
admin@LAPTOP-O7OIHPIJ:~$
728x90
반응형