Skilllibrary ssh-tmux-remote-workflow

install
source · Clone the upstream repo
git clone https://github.com/merceralex397-collab/skilllibrary
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/merceralex397-collab/skilllibrary "$T" && mkdir -p ~/.claude/skills && cp -r "$T/10-cli-systems-and-ops/ssh-tmux-remote-workflow" ~/.claude/skills/merceralex397-collab-skilllibrary-ssh-tmux-remote-workflow && rm -rf "$T"
manifest: 10-cli-systems-and-ops/ssh-tmux-remote-workflow/SKILL.md
source content

Purpose

Configure SSH connections, key management, jump hosts, and tmux sessions for reliable remote workflows.

When to use this skill

  • setting up
    ~/.ssh/config
    with host aliases, ProxyJump, and multiplexing
  • creating persistent tmux sessions for long-running remote work
  • syncing files between local and remote with
    rsync
  • debugging SSH connection failures or key issues

Do not use this skill when

  • writing systemd unit files on the remote host — prefer
    systemd-services
  • the task is container orchestration — different domain
  • doing local terminal debugging — prefer
    terminal-debugging

Procedure

  1. Generate keys
    ssh-keygen -t ed25519 -C "user@machine"
    . Copy:
    ssh-copy-id user@host
    .
  2. Configure SSH — edit
    ~/.ssh/config
    with host blocks for aliases, jump hosts, multiplexing.
  3. Enable multiplexing
    ControlMaster auto
    ,
    ControlPath ~/.ssh/sockets/%r@%h-%p
    ,
    ControlPersist 600
    .
  4. Jump hosts — use
    ProxyJump bastion
    to reach internal hosts through a bastion.
  5. Persistent tmux
    ssh host -t 'tmux new -s work || tmux attach -t work'
    .
  6. Sync files
    rsync -avz --exclude .git/ ./src/ host:~/project/src/
    .
  7. Port forwarding
    ssh -L 8080:localhost:3000 host
    for local access to remote services.
  8. Debug
    ssh -vvv host
    for verbose output; check
    /var/log/auth.log
    on server.

SSH config example

Host *
    AddKeysToAgent yes
    IdentityFile ~/.ssh/id_ed25519
    ControlMaster auto
    ControlPath ~/.ssh/sockets/%r@%h-%p
    ControlPersist 600
    ServerAliveInterval 60

Host bastion
    HostName bastion.example.com
    User deploy

Host internal
    HostName 10.0.1.50
    User deploy
    ProxyJump bastion

tmux essentials

tmux new -s dev           # new named session
tmux attach -t dev        # reattach
# Ctrl-b d  detach    Ctrl-b c  new window
# Ctrl-b %  vsplit    Ctrl-b "  hsplit

Decision rules

  • Use
    ed25519
    keys — faster and more secure than RSA.
  • Use
    ProxyJump
    over
    ssh -J
    — config is version-controllable.
  • Create
    ~/.ssh/sockets/
    directory — missing dir causes silent multiplexing failure.
  • Set
    ServerAliveInterval 60
    to prevent dropped idle connections.
  • Use
    tmux new -s name || tmux attach -t name
    to be idempotent.

References

Related skills

  • linux-ubuntu-ops
    — server management after SSH access
  • bash
    — scripting remote commands
  • terminal-debugging
    — debugging remote processes