← 전체로 돌아가기
스킬 linux

SSH X11 포워딩 설정

SSH로 원격 GUI 앱 실행을 위한 X11 포워딩 설정법

sshx11guilinuxmacos

원격 서버에서 GUI 앱을 띄우고 싶을 때 X11 포워딩을 설정해야 해. 클라이언트와 서버 양쪽에서 설정이 필요해.

클라이언트 설정

  • macOS: XQuartz를 설치해야 함.
  • SSH 설정: ~/.ssh/config 파일에 다음을 추가해줘.

    Host your_server_alias HostName your_server_ip User your_username ForwardX11 yes

서버 설정

  • /etc/ssh/sshd_config 파일에 X11Forwarding yes를 추가해.

    X11Forwarding yes * xauth 패키지 설치:

    bash sudo apt install xauth * sshd 재시작은 필요 없어.

여기서 배울 것

  1. X11 포워딩의 목적 이해
  2. 클라이언트와 서버 양쪽 설정 필요성
  3. SSH 설정 파일 (`ssh_config`, `sshd_config`) 수정법
  4. XQuartz 및 xauth 패키지의 역할 파악
원본 파일 보기 (.claude/skills/tn-x11-forwarding/SKILL.md)
---
name: SSH X11 포워딩 설정
description: Use when the user wants to enable X11 forwarding over SSH to run graphical applications remotely, covering both client (e.g., macOS XQuartz, ssh config) and server (e.g., sshd_config, xauth) setup.
version: 1.0.0
source: /home/son/prj/resume/backup_notes_260317/notion/Tech Note/x11 26ed7efd824b8015803bed16402d74d3.md
---

# x11

## Client

install xquartz (MacOS)

[https://www.xquartz.org/](https://www.xquartz.org/)

ssh config

Host your_server_alias
    HostName your_server_ip
    User your_username
    **ForwardX11 yes**

## Server

/etc/ssh/sshd_config

add 

X11Forwarding yes

sudo apt install xauth

no need to restart