Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. bash 를 실행해서 WSL 리눅스에 들어갑니다.
  2. 빠른 패키지 다운로드를 위해 ubuntu 미러를 국내 사이트로 변경합니다.

    Code Block
    curl -O https://gist.githubusercontent.com/lesstif/8185f143ba7b8881e767900b1c8e98ad/raw/54ceaed47410d64af25b1aaf691e4319c5daba4c/change-ubuntu-mirror.sh
    sudo bash change-ubuntu-mirror.sh
  3. 패키지 정보를 업데이트합니다.

    Code Block
    sudo apt update
    sudo apt upgrade
  4. openssh 서버를 재설치합니다.

    Code Block
    sudo apt remove openssh-server
    sudo apt install openssh-server
  5. sshd 설정 파일은 /etc/ssh/sshd_config  를 편집합니다.

    Code Block
    ## 다른 포트를 사용할 경우 수정
    Port 22
    ## 
    PermitRootLogin no
  6. 설정을 반영하기 위해 ssh 서버를 재구동합니다.

    Code Block
    sudo service ssh --full-restart
    sudo service ssh restart
  7. 이제 ssh 로 연결해서 정상 설정 여부를 확인합니다.
  8. 정상 동작한다면 ssh 시작시 암호 입력을 안 하도록 sudoers 파일을 수정합니다.
    1. visudo 를 실행합니다.
    2. 아래의 추가 부분을 기존 sudoers 에 추가합니다.

      Code Block
      %sudo   ALL=(ALL:ALL) ALL
      
      ## 추가
      %sudo   ALL=NOPASSWD: /usr/sbin/sshd start

qq

...

Windows 에서 WSL 내의 리눅스 파일을 수정하면 permission 이 날라가므로 Windows 내 파일을 수정하고 리눅스는 read 하도록 작업해야 함

Ex:

  • 작업 폴더 : c:\Users\lesstif\Sites\myproj
  • 리눅스의 PHP 는 /mnt/c/Users/lesstif/Sites/myproj 에 접근하여 serve


...

wsl.conf 로 동작 제어

/etc/wsl.conf 



같이 보기

...