C.W.K.
Stream
Lesson 02 of 14 · published

Fleet 위한 SSH Config Mastery

~15 min · ssh-config, host-lists, groups

Level 0Pinger
0 XP0/101 lessons0/12 achievements
0/150 XP to next level150 XP to go0% complete

기초

Track 3 가 ~/.ssh/config 만들었어. Fleet 관리가 그 위에 살아. 모든 스크립트, loop, Ansible playbook 이 동작하는 이유는 ssh hostname 그냥 동작 — flag 없음, IP 없음, 일관 설정.

Config 파일에 host 그룹

Plain text host list 가 SSH config 를 fleet inventory 로 바꿈. ~/.fleet/ 또는 dotfiles repo 에 보관 — 논리 그룹별 한 파일, host 별 한 줄. 모든 fleet 도구가 이거 읽음 — 셸 loop, pssh, Ansible 까지.

Code

Fleet-ready ~/.ssh/config·ssh-config
# Workstations
Host office
    HostName 192.168.1.10
    User you_username
Host server
    HostName 192.168.1.11
    User you_username
Host music
    HostName 192.168.1.12
    User you_username
Host worker
    HostName 192.168.1.13
    User you_username

# Portables
Host macbook
    HostName 192.168.1.20
    User you_username
Host pro2024
    HostName 192.168.1.21
    User you_username
Host pro2023
    HostName 192.168.1.22
    User you_username
Host mini
    HostName 192.168.1.30
    User you_username

# Tailscale (Track 6)
Host ts-*
    User you_username

Host *
    AddKeysToAgent yes
    UseKeychain yes
    IdentityFile ~/.ssh/id_ed25519
    ServerAliveInterval 60
    ControlMaster auto
    ControlPath ~/.ssh/sockets/%r@%h-%p
    ControlPersist 10m
Host list (~/.fleet/)·bash
# ~/.fleet/all.txt
office
server
music
worker
macbook
pro2024
pro2023
air
mini

# ~/.fleet/workstations.txt
office
server
music
worker

# ~/.fleet/laptops.txt
macbook
pro2024
pro2023
air

Exercise

~/.ssh/config 가 위 구조와 일치하는지 확인 (Host * 맨 아래, ControlMaster 활성화 등). 그다음 모든 host alias 의 ~/.fleet/all.txt 생성. 부분집합 위해 ~/.fleet/workstations.txt~/.fleet/laptops.txt 추가. 5 분 투자, 몇 년 보답.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.