Skip to content

Trouble Shooting

Kim Minseok edited this page Mar 20, 2025 · 4 revisions

WSL connection이 안될 때

WSL을 ssh로 연결하기

✅ 1. WSL에서 SSH 서버 실행

1️⃣ WSL에 SSH 서버 설치 (한 번만 실행)

sudo apt update && sudo apt install openssh-server -y

2️⃣ SSH 설정 파일 수정

  • vscode로 편집
code /etc/ssh/sshd_config
  • vim으로 편집
vim /etc/ssh/sshd_config

아래 내용 찾아서 수정

#Port 22 → Port 2222 (포트 변경, 이 부분은 필요 시에만 변경)
#PasswordAuthentication yes → PasswordAuthentication yes (비밀번호 로그인 허용)

3️⃣ SSH 서비스 시작 및 활성화

서비스 시작 및 활성화

sudo service ssh start

상태 확인(running이면 정상)

sudo service ssh status

매번 부팅 할 때 마다 자동으로 실행

sudo systemctl enable ssh

✅ 2. WSL IP 주소 확인

WSL 접속 후 아래 명령어 실행

hostname -I

출력 예시:

172.18.64.1

위 IP주소가 WSL의 로컬 IP주소입니다.

✅ 3. Windows Intellij에서 ssh로 접속

1️⃣ Intellij 메인 프로젝트 화면에서 좌측 Remote Development에서 SSH 선택 -> New Project 혹은 Connect to Host

(프로젝트가 이미 열린 상태에서 이 화면을 띄우려면 File -> Close Project로 갈 수 있음)

image

2️⃣ Connection -> Open Settings

image

3️⃣ 왼쪽 위 + 버튼 (add)

image

4️⃣ SSH 호스트 설정

image

  • Host에 위에서 hostname -I로 파악한 wsl의 ip주소와 포트(기본 22) 입력
  • Authentication type에 password 선택
  • Username에 wsl 유저 이름 입력
  • password 입력 후 OK

5️⃣ Check Connection and Continue

image

6️⃣ git clone한 레포지토리를 Project Directory로 선택 후 Start IDE and Connect

image

Clone this wiki locally