...
- bash 를 실행해서 WSL 리눅스에 들어갑니다.
빠른 패키지 다운로드를 위해 ubuntu 미러를 국내 사이트로 변경합니다.
Code Block curl -O https://gist.githubusercontent.com/lesstif/8185f143ba7b8881e767900b1c8e98ad/raw/54ceaed47410d64af25b1aaf691e4319c5daba4c/change-ubuntu-mirror.sh sudo bash change-ubuntu-mirror.sh
패키지 정보를 업데이트합니다.
Code Block sudo apt update sudo apt upgrade
openssh 서버를 재설치합니다.
Code Block sudo apt remove openssh-server sudo apt install openssh-server
sshd 설정 파일은 /etc/ssh/sshd_config 를 편집합니다.
Code Block ## 다른 포트를 사용할 경우 수정 Port 22 ## PermitRootLogin no ## PasswordAuthentication yes
설정을 반영하기 위해 ssh 서버를 재구동합니다.
Code Block sudo service ssh --full-restart sudo service ssh restart
- 이제 ssh 로 연결해서 정상 설정 여부를 확인합니다.
- 정상 동작한다면 ssh 시작시 암호 입력을 안 하도록 sudoers 파일을 수정합니다.
- visudo 를 실행합니다.
아래의 추가 부분을 기존 sudoers 에 추가합니다.
Code Block %sudo ALL=(ALL:ALL) ALL ## 추가 %sudo ALL=NOPASSWD: /usr/sbin/sshd start
wsl.conf 로 동작 제어
Code Block | ||
---|---|---|
| ||
# Enable extra metadata options by default
[automount]
enabled = true
root = /mnt/
options = "metadata,umask=22,fmask=11"
mountFsTab = true
# Enable DNS – even though these are turned on by default, we’ll specify here just to be explicit.
[network]
generateHosts = true
generateResolvConf = true |
같이 보기
- WSL(Windows Subsystem for Linux) 폴더를 Windows depender 예외 폴더 처리하기
- WSL 2(Windows Subsystem For Linux 2) Preview 버전 사용하기