[Remote] Cursor & VS Code 의 SSH Remote 설정

JAsmine_log·2026년 1월 21일

SSH Remote

linux 서버 구축하고 사용하고 있었는데, GUI로는 너무 느려서 VS Code와 Cursor로 ssh remote 연결해서 사용하기로했다

기본적으로 사용 방법이 같아서, 동일하게 실행해서 editor만 본인이 원하는 대로 설정하면 된다!

Server 설정 (Ubuntu 24.04)

  1. openssh-server 설치
  2. ssh 서비스 실행
  3. 계정 생성
  4. SSH 키 등록(안해도 실행되긴 했음)
  5. 방화벽에서 22번 허용

OpenSSH 설치 및 실행

sudo apt update
sudo apt install -y openssh-server

SSH 서비스 상태 확인

  • 실행 상태 확인
sudo systemctl status ssh
  • disable(red color)로 되어 있으면, 아래 명령어 실행
sudo systemctl enable ssh
sudo systemctl start ssh
# sudo systemctl restart ssh

IP & Hostname 확인

ip a
# 또는
hostname -I

Server 계정(account) 확인

whoami
# 또는
cat /etc/passwd
  • 필요하면 새로 추가
sudo adduser yourname
sudo usermod -aG sudo yourname

ufw 확인

sudo ufw allow ssh
sudo ufw allow 22/tcp
sudo ufw reload
# sudo systemctl restart ssh
  • 만약에 포트가 안열려 있거나 하면 아래 내용 확인
ss -ntl | grep :22
LISTEN 0 128 0.0.0.0:22 # port가 열려 있는 경우

Client(Local) 설정

Server 연결상태 확인

  • cmd 에서
ping 192.168.205.69

VS Code 설정 (Cursor동일)

  1. Extensions → Remote - SSH 검색해서 설치
  2. F1Remote-SSH: Connect to Host 선택 후,
  3. blank에 아래 내용 입력:
server_account@192.168.0.IP 
  1. 연결되면, password 입력
  2. 나중에 연결 설정 수정할 때 nano ~/.ssh/config로 들어가서, 필요시 수정
Host lab-server
    HostName {192.168.0.IP}
    User {server_account}
    IdentityFile ~/.ssh/id_ed25519
profile
Everyday Research & Development

0개의 댓글