[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6FBVS98769BSRW1YZAVW246":3,"skill-same:01M6FBVS98769BSRW1YZAVW246":78},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":44,"linkOnly":45,"markdownContent":46,"markdownBody":47,"frontMatter":48,"refName":31,"commitSha":58,"skillDirectory":59,"forksCount":60,"repositoryHtmlUrl":61,"repositoryHomepageUrl":6,"ownerHtmlUrl":62,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":63,"install":64,"resources":77},"01M6FBVS98769BSRW1YZAVW246","ssh-configuration",null,"Configure SSH servers and clients securely. Manage keys, tunnels, and config files. Use when setting up secure remote access.","boisenoise\u002Fskills-collections","boisenoise","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F193180?v=4","01M6CDBDQK6BDN55ZMA6B6PKBM","01M6CDBDVSJ3JPTBYN26FZ7TZK",13,"MIT","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-ssh-configuration\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],"ssh configuration","ssh","configuration","community","2026","when","remote","relevant","helper","scripts","critical","os","platform","main","config","manage","files","agent-skills","up","only","use","configure","access","devops-security","license","secure","2026-11-10 10:12:30",false,"---\nname: ssh-configuration\ndescription: Configure SSH servers and clients securely. Manage keys, tunnels, and\n  config files. Use when setting up secure remote access.\ncategory: devops\nrisk: critical\nsource: https:\u002F\u002Fgithub.com\u002FBagelHole\u002FDevOps-Security-Agent-Skills\nsource_repo: BagelHole\u002FDevOps-Security-Agent-Skills\nsource_type: community\ndate_added: '2026-09-20'\nlicense: MIT\nlicense_source: https:\u002F\u002Fgithub.com\u002FBagelHole\u002FDevOps-Security-Agent-Skills\u002Fblob\u002Fmain\u002FLICENSE\ncompatibility: Requires the relevant OS\u002Fplatform tooling and privileged access where\n  noted. Docs-only; helper scripts and templates not bundled.\nmetadata:\n  author: devops-skills\n  version: '1.0'\n---\n\n# SSH Configuration\n\nSecure SSH server and client configuration for production environments, including key management, hardened sshd settings, bastion host architecture, tunneling, and multiplexing.\n\n## When to Use\n\n- Setting up secure remote access to Linux or Unix servers\n- Hardening SSH daemon configuration to meet compliance requirements\n- Configuring bastion \u002F jump hosts for private network access\n- Creating SSH tunnels for secure port forwarding\n- Managing SSH keys for teams or automated deployments\n- Troubleshooting connection, authentication, or performance issues\n\n## Prerequisites\n\n- OpenSSH client installed locally (`ssh -V` to verify)\n- OpenSSH server installed on target (`sshd`)\n- Root or sudo access on the server for sshd_config changes\n- Firewall rules allowing TCP port 22 (or custom SSH port)\n\n## Access preservation\n\nInspect existing config\u002Fincludes and protect private keys; do not overwrite an existing identity. Before disabling password\u002Froot access verify the intended account, authorized key and recovery console, then validate effective Match configuration and test a second session. Adapt subsystem paths\u002Falgorithms to the installed OpenSSH version; changing crypto lists is not a compliance guarantee. Restrict tunnels to approved destinations and loopback listeners. Agent forwarding exposes signing capability on the intermediate host, not the private key bytes themselves. See [sshd_config](https:\u002F\u002Fman.openbsd.org\u002Fsshd_config).\n\n## Key Generation and Management\n\n```bash\n# Generate an Ed25519 key (recommended -- fast, secure, short)\nssh-keygen -t ed25519 -C \"jane@example.com\" -f ~\u002F.ssh\u002Fid_ed25519\n\n# Generate an RSA 4096-bit key (for legacy compatibility)\nssh-keygen -t rsa -b 4096 -C \"jane@example.com\" -f ~\u002F.ssh\u002Fid_rsa_legacy\n\n# Generate a key with a custom comment and no passphrase (CI\u002FCD use only)\nssh-keygen -t ed25519 -C \"ci-deploy-key\" -f ~\u002F.ssh\u002Fci_deploy -N \"\"\n\n# Copy public key to a remote server\nssh-copy-id -i ~\u002F.ssh\u002Fid_ed25519.pub user@server\n\n# Manually append a public key (when ssh-copy-id is unavailable)\ncat ~\u002F.ssh\u002Fid_ed25519.pub | ssh user@server \"mkdir -p ~\u002F.ssh && chmod 700 ~\u002F.ssh && cat >> ~\u002F.ssh\u002Fauthorized_keys && chmod 600 ~\u002F.ssh\u002Fauthorized_keys\"\n\n# List fingerprints of keys on the agent\nssh-add -l\n\n# Start the SSH agent and add a key\neval \"$(ssh-agent -s)\"\nssh-add ~\u002F.ssh\u002Fid_ed25519\n\n# Add a key with a lifetime (auto-removed after 8 hours)\nssh-add -t 28800 ~\u002F.ssh\u002Fid_ed25519\n\n# Remove all keys from the agent\nssh-add -D\n\n# Convert an OpenSSH key to PEM format (for tools that need it)\nssh-keygen -p -m PEM -f ~\u002F.ssh\u002Fid_rsa_legacy\n\n# Show the public key fingerprint (SHA256)\nssh-keygen -lf ~\u002F.ssh\u002Fid_ed25519.pub\n\n# Rotate a key: generate new, deploy, then revoke old\nssh-keygen -t ed25519 -f ~\u002F.ssh\u002Fid_ed25519_new -C \"jane@example.com rotated $(date +%Y-%m)\"\nssh-copy-id -i ~\u002F.ssh\u002Fid_ed25519_new.pub user@server\n# After verifying the new key works, remove the old public key from authorized_keys on the server\n```\n\n## SSH Client Configuration (~\u002F.ssh\u002Fconfig)\n\n```text\n# Global defaults applied to all hosts\nHost *\n  AddKeysToAgent yes\n  IdentitiesOnly yes\n  ServerAliveInterval 60\n  ServerAliveCountMax 3\n  TCPKeepAlive yes\n  Compression yes\n\n# Production servers via bastion\nHost bastion\n  HostName bastion.example.com\n  User ops\n  IdentityFile ~\u002F.ssh\u002Fid_ed25519\n  Port 22\n\nHost prod-web-*\n  User deploy\n  IdentityFile ~\u002F.ssh\u002Fid_ed25519\n  ProxyJump bastion\n  Port 22\n\nHost prod-web-1\n  HostName 10.0.1.10\n\nHost prod-web-2\n  HostName 10.0.1.11\n\n# Staging accessed directly\nHost staging\n  HostName staging.example.com\n  User deploy\n  IdentityFile ~\u002F.ssh\u002Fid_ed25519_staging\n\n# Database tunnel through bastion\nHost db-tunnel\n  HostName 10.0.2.50\n  User dba\n  ProxyJump bastion\n  LocalForward 5432 localhost:5432\n\n# GitHub deploy key\nHost github-deploy\n  HostName github.com\n  User git\n  IdentityFile ~\u002F.ssh\u002Fgithub_deploy_key\n  IdentitiesOnly yes\n\n# Connection multiplexing for faster repeated connections\nHost fast-*\n  ControlMaster auto\n  ControlPath ~\u002F.ssh\u002Fsockets\u002F%r@%h-%p\n  ControlPersist 600\n```\n\n```bash\n# Create the sockets directory for multiplexing\nmkdir -p ~\u002F.ssh\u002Fsockets\nchmod 700 ~\u002F.ssh\u002Fsockets\n```\n\n## Hardened Server Configuration (\u002Fetc\u002Fssh\u002Fsshd_config)\n\n```bash\n# \u002Fetc\u002Fssh\u002Fsshd_config -- hardened configuration\n# -----------------------------------------------\n\n# Listen on a non-default port (obscurity, not security -- combine with firewall)\nPort 22\n\n# Protocol and key exchange\nProtocol 2\nKexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group16-sha512\nCiphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com\nMACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com\n\n# Authentication\nPermitRootLogin no\nPasswordAuthentication no\nPubkeyAuthentication yes\nAuthenticationMethods publickey\nMaxAuthTries 3\nMaxSessions 5\nLoginGraceTime 30\n\n# Restrict users and groups\nAllowGroups ssh-users ops-team\n# AllowUsers deploy admin\n\n# Disable unused authentication methods\nChallengeResponseAuthentication no\nKerberosAuthentication no\nGSSAPIAuthentication no\n\n# Forwarding controls\nAllowTcpForwarding yes\nAllowAgentForwarding no\nX11Forwarding no\nPermitTunnel no\n\n# Security hardening\nClientAliveInterval 300\nClientAliveCountMax 2\nUsePAM yes\nUseDNS no\nPermitEmptyPasswords no\nPermitUserEnvironment no\n\n# Logging\nSyslogFacility AUTH\nLogLevel VERBOSE\n\n# SFTP subsystem\nSubsystem sftp \u002Fusr\u002Flib\u002Fopenssh\u002Fsftp-server -f AUTH -l INFO\n\n# Match block: restrict deploy user to SFTP only\nMatch User sftponly\n  ForceCommand internal-sftp\n  ChrootDirectory \u002Fhome\u002F%u\n  AllowTcpForwarding no\n  AllowAgentForwarding no\n  X11Forwarding no\n```\n\n```bash\n# Validate configuration before restarting\nsshd -t\n\n# Restart sshd to apply changes\nsystemctl restart sshd\n\n# Always keep an existing session open while testing\n# Open a NEW terminal to verify you can still connect before closing the old one\n```\n\n## Bastion Host Setup\n\n```bash\n# On the bastion server, restrict forwarding to internal subnets only\n# \u002Fetc\u002Fssh\u002Fsshd_config addition on bastion:\nAllowTcpForwarding yes\nPermitOpen 10.0.1.10:22 10.0.2.50:5432\n# PermitOpen takes explicit host:port targets, not CIDR subnet rules.\n\n# Disable shell access for jump-only users\nMatch User jump-user\n  PermitTTY no\n  ForceCommand \u002Fusr\u002Fsbin\u002Fnologin\n  AllowTcpForwarding yes\n\n# Connect through the bastion from a client in one command\nssh -J ops@bastion.example.com deploy@10.0.1.10\n\n# Equivalent using ProxyCommand (older SSH versions)\nssh -o ProxyCommand=\"ssh -W %h:%p ops@bastion.example.com\" deploy@10.0.1.10\n\n# Multi-hop: client -> bastion -> app-server -> db-server\nssh -J ops@bastion,deploy@10.0.1.10 dba@10.0.2.50\n```\n\n## SSH Tunneling\n\n```bash\n# Local port forward: access remote service on localhost\n# Access remote PostgreSQL (10.0.2.50:5432) via bastion at localhost:5432\nssh -L 5432:10.0.2.50:5432 ops@bastion.example.com -N\n\n# Remote port forward: expose local service to the remote network\n# Make local dev server (localhost:3000) available on server port 8080\nssh -R 8080:localhost:3000 user@server -N\n\n# Dynamic SOCKS proxy: route all traffic through the server\nssh -D 1080 user@server -N\n# Then configure browser or apps to use SOCKS5 proxy at localhost:1080\n\n# Tunnel with a background process\nssh -fN -L 5432:10.0.2.50:5432 ops@bastion.example.com\n# Find and kill the tunnel later\nps aux | grep \"ssh -fN\" | grep -v grep\nkill \u003Cpid>\n\n# Autossh for persistent tunnels (auto-reconnects)\nautossh -M 0 -f -N -L 5432:10.0.2.50:5432 ops@bastion.example.com \\\n  -o \"ServerAliveInterval=30\" -o \"ServerAliveCountMax=3\"\n```\n\n## Agent Forwarding (Use with Caution)\n\n```bash\n# Enable agent forwarding for a single connection\nssh -A user@bastion\n\n# From the bastion, your local keys are available to authenticate further\nssh deploy@10.0.1.10   # Uses your local key via the agent\n\n# SECURITY WARNING: Agent forwarding exposes your keys to anyone with root\n# on the intermediate host. Prefer ProxyJump instead.\n\n# Safer alternative: ProxyJump does not expose the agent\nssh -J ops@bastion deploy@10.0.1.10\n```\n\n## SSH Key Restrictions in authorized_keys\n\n```text\n# Restrict a key to a specific command only (backup key)\ncommand=\"\u002Fusr\u002Flocal\u002Fbin\u002Frun-backup.sh\",no-port-forwarding,no-X11-forwarding,no-agent-forwarding ssh-ed25519 AAAA... backup@example.com\n\n# Restrict a key to specific source IPs\nfrom=\"10.0.0.0\u002F24,192.168.1.0\u002F24\" ssh-ed25519 AAAA... admin@example.com\n\n# SFTP-only key; read-only and chroot require separate server\u002Ffilesystem policy\ncommand=\"internal-sftp\",no-port-forwarding,no-pty ssh-ed25519 AAAA... sftp-upload@example.com\n```\n\n## Troubleshooting\n\n| Symptom | Diagnostic Command | Common Fix |\n|---|---|---|\n| Connection refused | `ss -tlnp \\| grep 22` on server | Ensure sshd is running; check firewall rules |\n| Permission denied (publickey) | `ssh -vvv user@server` | Verify key is in authorized_keys, permissions 600\u002F700 |\n| Host key verification failed | Compare the new host-key fingerprint with a trusted independent channel | Remove an old entry only after identity verification; never bypass checking to make login work |\n| Connection timeout | `ssh -o ConnectTimeout=5 user@server` | Check network path, security groups, NACLs |\n| Slow SSH login | Check `UseDNS` in sshd_config | Set `UseDNS no`; check reverse DNS |\n| Broken pipe \u002F dropped sessions | Add `ServerAliveInterval 60` to config | Configure keepalive on both client and server |\n| Agent forwarding not working | `ssh-add -l` on bastion | Ensure `-A` flag used and agent has keys loaded |\n| Tunnel port already in use | `ss -tlnp \\| grep \u003Cport>` | Kill existing tunnel or use a different local port |\n\n## Related Skills\n\n- `linux-administration` -- General Linux system administration\n- `user-management` -- Managing the users who connect via SSH\n- `systemd-services` -- Managing sshd as a systemd service\n- `performance-tuning` -- Network tuning for SSH performance\n\n## Limitations\n\n- Infrastructure commands can disrupt services: confirm target host\u002Fscope and have backups\u002Fsnapshots before mutating state.\n- Docs-only import: upstream scripts and templates not bundled.\n\n","# SSH Configuration\n\nSecure SSH server and client configuration for production environments, including key management, hardened sshd settings, bastion host architecture, tunneling, and multiplexing.\n\n## When to Use\n\n- Setting up secure remote access to Linux or Unix servers\n- Hardening SSH daemon configuration to meet compliance requirements\n- Configuring bastion \u002F jump hosts for private network access\n- Creating SSH tunnels for secure port forwarding\n- Managing SSH keys for teams or automated deployments\n- Troubleshooting connection, authentication, or performance issues\n\n## Prerequisites\n\n- OpenSSH client installed locally (`ssh -V` to verify)\n- OpenSSH server installed on target (`sshd`)\n- Root or sudo access on the server for sshd_config changes\n- Firewall rules allowing TCP port 22 (or custom SSH port)\n\n## Access preservation\n\nInspect existing config\u002Fincludes and protect private keys; do not overwrite an existing identity. Before disabling password\u002Froot access verify the intended account, authorized key and recovery console, then validate effective Match configuration and test a second session. Adapt subsystem paths\u002Falgorithms to the installed OpenSSH version; changing crypto lists is not a compliance guarantee. Restrict tunnels to approved destinations and loopback listeners. Agent forwarding exposes signing capability on the intermediate host, not the private key bytes themselves. See [sshd_config](https:\u002F\u002Fman.openbsd.org\u002Fsshd_config).\n\n## Key Generation and Management\n\n```bash\n# Generate an Ed25519 key (recommended -- fast, secure, short)\nssh-keygen -t ed25519 -C \"jane@example.com\" -f ~\u002F.ssh\u002Fid_ed25519\n\n# Generate an RSA 4096-bit key (for legacy compatibility)\nssh-keygen -t rsa -b 4096 -C \"jane@example.com\" -f ~\u002F.ssh\u002Fid_rsa_legacy\n\n# Generate a key with a custom comment and no passphrase (CI\u002FCD use only)\nssh-keygen -t ed25519 -C \"ci-deploy-key\" -f ~\u002F.ssh\u002Fci_deploy -N \"\"\n\n# Copy public key to a remote server\nssh-copy-id -i ~\u002F.ssh\u002Fid_ed25519.pub user@server\n\n# Manually append a public key (when ssh-copy-id is unavailable)\ncat ~\u002F.ssh\u002Fid_ed25519.pub | ssh user@server \"mkdir -p ~\u002F.ssh && chmod 700 ~\u002F.ssh && cat >> ~\u002F.ssh\u002Fauthorized_keys && chmod 600 ~\u002F.ssh\u002Fauthorized_keys\"\n\n# List fingerprints of keys on the agent\nssh-add -l\n\n# Start the SSH agent and add a key\neval \"$(ssh-agent -s)\"\nssh-add ~\u002F.ssh\u002Fid_ed25519\n\n# Add a key with a lifetime (auto-removed after 8 hours)\nssh-add -t 28800 ~\u002F.ssh\u002Fid_ed25519\n\n# Remove all keys from the agent\nssh-add -D\n\n# Convert an OpenSSH key to PEM format (for tools that need it)\nssh-keygen -p -m PEM -f ~\u002F.ssh\u002Fid_rsa_legacy\n\n# Show the public key fingerprint (SHA256)\nssh-keygen -lf ~\u002F.ssh\u002Fid_ed25519.pub\n\n# Rotate a key: generate new, deploy, then revoke old\nssh-keygen -t ed25519 -f ~\u002F.ssh\u002Fid_ed25519_new -C \"jane@example.com rotated $(date +%Y-%m)\"\nssh-copy-id -i ~\u002F.ssh\u002Fid_ed25519_new.pub user@server\n# After verifying the new key works, remove the old public key from authorized_keys on the server\n```\n\n## SSH Client Configuration (~\u002F.ssh\u002Fconfig)\n\n```text\n# Global defaults applied to all hosts\nHost *\n  AddKeysToAgent yes\n  IdentitiesOnly yes\n  ServerAliveInterval 60\n  ServerAliveCountMax 3\n  TCPKeepAlive yes\n  Compression yes\n\n# Production servers via bastion\nHost bastion\n  HostName bastion.example.com\n  User ops\n  IdentityFile ~\u002F.ssh\u002Fid_ed25519\n  Port 22\n\nHost prod-web-*\n  User deploy\n  IdentityFile ~\u002F.ssh\u002Fid_ed25519\n  ProxyJump bastion\n  Port 22\n\nHost prod-web-1\n  HostName 10.0.1.10\n\nHost prod-web-2\n  HostName 10.0.1.11\n\n# Staging accessed directly\nHost staging\n  HostName staging.example.com\n  User deploy\n  IdentityFile ~\u002F.ssh\u002Fid_ed25519_staging\n\n# Database tunnel through bastion\nHost db-tunnel\n  HostName 10.0.2.50\n  User dba\n  ProxyJump bastion\n  LocalForward 5432 localhost:5432\n\n# GitHub deploy key\nHost github-deploy\n  HostName github.com\n  User git\n  IdentityFile ~\u002F.ssh\u002Fgithub_deploy_key\n  IdentitiesOnly yes\n\n# Connection multiplexing for faster repeated connections\nHost fast-*\n  ControlMaster auto\n  ControlPath ~\u002F.ssh\u002Fsockets\u002F%r@%h-%p\n  ControlPersist 600\n```\n\n```bash\n# Create the sockets directory for multiplexing\nmkdir -p ~\u002F.ssh\u002Fsockets\nchmod 700 ~\u002F.ssh\u002Fsockets\n```\n\n## Hardened Server Configuration (\u002Fetc\u002Fssh\u002Fsshd_config)\n\n```bash\n# \u002Fetc\u002Fssh\u002Fsshd_config -- hardened configuration\n# -----------------------------------------------\n\n# Listen on a non-default port (obscurity, not security -- combine with firewall)\nPort 22\n\n# Protocol and key exchange\nProtocol 2\nKexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group16-sha512\nCiphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com\nMACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com\n\n# Authentication\nPermitRootLogin no\nPasswordAuthentication no\nPubkeyAuthentication yes\nAuthenticationMethods publickey\nMaxAuthTries 3\nMaxSessions 5\nLoginGraceTime 30\n\n# Restrict users and groups\nAllowGroups ssh-users ops-team\n# AllowUsers deploy admin\n\n# Disable unused authentication methods\nChallengeResponseAuthentication no\nKerberosAuthentication no\nGSSAPIAuthentication no\n\n# Forwarding controls\nAllowTcpForwarding yes\nAllowAgentForwarding no\nX11Forwarding no\nPermitTunnel no\n\n# Security hardening\nClientAliveInterval 300\nClientAliveCountMax 2\nUsePAM yes\nUseDNS no\nPermitEmptyPasswords no\nPermitUserEnvironment no\n\n# Logging\nSyslogFacility AUTH\nLogLevel VERBOSE\n\n# SFTP subsystem\nSubsystem sftp \u002Fusr\u002Flib\u002Fopenssh\u002Fsftp-server -f AUTH -l INFO\n\n# Match block: restrict deploy user to SFTP only\nMatch User sftponly\n  ForceCommand internal-sftp\n  ChrootDirectory \u002Fhome\u002F%u\n  AllowTcpForwarding no\n  AllowAgentForwarding no\n  X11Forwarding no\n```\n\n```bash\n# Validate configuration before restarting\nsshd -t\n\n# Restart sshd to apply changes\nsystemctl restart sshd\n\n# Always keep an existing session open while testing\n# Open a NEW terminal to verify you can still connect before closing the old one\n```\n\n## Bastion Host Setup\n\n```bash\n# On the bastion server, restrict forwarding to internal subnets only\n# \u002Fetc\u002Fssh\u002Fsshd_config addition on bastion:\nAllowTcpForwarding yes\nPermitOpen 10.0.1.10:22 10.0.2.50:5432\n# PermitOpen takes explicit host:port targets, not CIDR subnet rules.\n\n# Disable shell access for jump-only users\nMatch User jump-user\n  PermitTTY no\n  ForceCommand \u002Fusr\u002Fsbin\u002Fnologin\n  AllowTcpForwarding yes\n\n# Connect through the bastion from a client in one command\nssh -J ops@bastion.example.com deploy@10.0.1.10\n\n# Equivalent using ProxyCommand (older SSH versions)\nssh -o ProxyCommand=\"ssh -W %h:%p ops@bastion.example.com\" deploy@10.0.1.10\n\n# Multi-hop: client -> bastion -> app-server -> db-server\nssh -J ops@bastion,deploy@10.0.1.10 dba@10.0.2.50\n```\n\n## SSH Tunneling\n\n```bash\n# Local port forward: access remote service on localhost\n# Access remote PostgreSQL (10.0.2.50:5432) via bastion at localhost:5432\nssh -L 5432:10.0.2.50:5432 ops@bastion.example.com -N\n\n# Remote port forward: expose local service to the remote network\n# Make local dev server (localhost:3000) available on server port 8080\nssh -R 8080:localhost:3000 user@server -N\n\n# Dynamic SOCKS proxy: route all traffic through the server\nssh -D 1080 user@server -N\n# Then configure browser or apps to use SOCKS5 proxy at localhost:1080\n\n# Tunnel with a background process\nssh -fN -L 5432:10.0.2.50:5432 ops@bastion.example.com\n# Find and kill the tunnel later\nps aux | grep \"ssh -fN\" | grep -v grep\nkill \u003Cpid>\n\n# Autossh for persistent tunnels (auto-reconnects)\nautossh -M 0 -f -N -L 5432:10.0.2.50:5432 ops@bastion.example.com \\\n  -o \"ServerAliveInterval=30\" -o \"ServerAliveCountMax=3\"\n```\n\n## Agent Forwarding (Use with Caution)\n\n```bash\n# Enable agent forwarding for a single connection\nssh -A user@bastion\n\n# From the bastion, your local keys are available to authenticate further\nssh deploy@10.0.1.10   # Uses your local key via the agent\n\n# SECURITY WARNING: Agent forwarding exposes your keys to anyone with root\n# on the intermediate host. Prefer ProxyJump instead.\n\n# Safer alternative: ProxyJump does not expose the agent\nssh -J ops@bastion deploy@10.0.1.10\n```\n\n## SSH Key Restrictions in authorized_keys\n\n```text\n# Restrict a key to a specific command only (backup key)\ncommand=\"\u002Fusr\u002Flocal\u002Fbin\u002Frun-backup.sh\",no-port-forwarding,no-X11-forwarding,no-agent-forwarding ssh-ed25519 AAAA... backup@example.com\n\n# Restrict a key to specific source IPs\nfrom=\"10.0.0.0\u002F24,192.168.1.0\u002F24\" ssh-ed25519 AAAA... admin@example.com\n\n# SFTP-only key; read-only and chroot require separate server\u002Ffilesystem policy\ncommand=\"internal-sftp\",no-port-forwarding,no-pty ssh-ed25519 AAAA... sftp-upload@example.com\n```\n\n## Troubleshooting\n\n| Symptom | Diagnostic Command | Common Fix |\n|---|---|---|\n| Connection refused | `ss -tlnp \\| grep 22` on server | Ensure sshd is running; check firewall rules |\n| Permission denied (publickey) | `ssh -vvv user@server` | Verify key is in authorized_keys, permissions 600\u002F700 |\n| Host key verification failed | Compare the new host-key fingerprint with a trusted independent channel | Remove an old entry only after identity verification; never bypass checking to make login work |\n| Connection timeout | `ssh -o ConnectTimeout=5 user@server` | Check network path, security groups, NACLs |\n| Slow SSH login | Check `UseDNS` in sshd_config | Set `UseDNS no`; check reverse DNS |\n| Broken pipe \u002F dropped sessions | Add `ServerAliveInterval 60` to config | Configure keepalive on both client and server |\n| Agent forwarding not working | `ssh-add -l` on bastion | Ensure `-A` flag used and agent has keys loaded |\n| Tunnel port already in use | `ss -tlnp \\| grep \u003Cport>` | Kill existing tunnel or use a different local port |\n\n## Related Skills\n\n- `linux-administration` -- General Linux system administration\n- `user-management` -- Managing the users who connect via SSH\n- `systemd-services` -- Managing sshd as a systemd service\n- `performance-tuning` -- Network tuning for SSH performance\n\n## Limitations\n\n- Infrastructure commands can disrupt services: confirm target host\u002Fscope and have backups\u002Fsnapshots before mutating state.\n- Docs-only import: upstream scripts and templates not bundled.\n\n",{"name":5,"risk":28,"source":49,"license":14,"category":50,"metadata":51,"date_added":54,"description":7,"source_repo":55,"source_type":21,"compatibility":56,"license_source":57},"https:\u002F\u002Fgithub.com\u002FBagelHole\u002FDevOps-Security-Agent-Skills","devops",{"author":52,"version":53},"devops-skills","1.0","2026-09-20","BagelHole\u002FDevOps-Security-Agent-Skills","Requires the relevant OS\u002Fplatform tooling and privileged access where noted. Docs-only; helper scripts and templates not bundled.","https:\u002F\u002Fgithub.com\u002FBagelHole\u002FDevOps-Security-Agent-Skills\u002Fblob\u002Fmain\u002FLICENSE","7bf2279c8a65758319526a721d5c4b75683aec9c","skills\u002Fantigravity-ssh-configuration",3,"https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections","https:\u002F\u002Fgithub.com\u002Fboisenoise","2026-11-14 14:18:11",{"source":8,"skillName":5,"commands":65,"prompt":75,"zipAvailable":76},[66,69,72],{"tool":67,"command":68},"npx","npx skills add boisenoise\u002Fskills-collections --skill ssh-configuration",{"tool":70,"command":71},"bunx","bunx skills add boisenoise\u002Fskills-collections --skill ssh-configuration",{"tool":73,"command":74},"pnpm","pnpm dlx skills add boisenoise\u002Fskills-collections --skill ssh-configuration","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-ssh-configuration\u002FSKILL.md",true,[],[79,88,96,105,113,121],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":83,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":87},"01M7B6HREHB53EHGGVZND7DDXN","scrapely-scrape","Collect web data with ready-made Scrape.ly scrapers: Google Maps places, Amazon products, LinkedIn jobs, reviews, social posts. Use when the user wants structured data from a site.","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-scrapely-scrape\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-scrapely-scrape\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":92,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":87},"01M7B6GDNNN4HE662KA6KPF7GW","lumify-odds","Lumify's hosted sports MCP\u002FREST API for sportsbook odds, line-movement history, public betting splits, and player props across MLB, NFL, NBA, NHL, soccer, tennis, NCAAF, NCAAB. Read-only market data.","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-lumify-odds\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-lumify-odds\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":100,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":104},"01M743PZMJW2GEKG5J199GPSK7","sync-lipsync","Lip-sync an existing video of a real person to new audio or a typed script with sync. labs through its hosted MCP server, quoting the cost and waiting for approval first.","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-sync-lipsync\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-sync-lipsync\u002FSKILL.md",[],[],"2026-11-11 15:11:14",{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":109,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":104},"01M743MMN3CKTJVNRSZMB684E5","music-for-robots","Optional music-inspired creative exercise for multimodal agents. Ingests an unquantized acoustic MP3 composition by Michael Luchtan (Music For Robots) into a private temporary directory, analyzing microtiming and texture to inspire creative writing, brainstorming, or technical tasks.","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-music-for-robots\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-music-for-robots\u002FSKILL.md",[],[],{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":117,"sourceHtmlUrl":118,"categories":119,"keywords":120,"publishedAt":104},"01M743KC2GN5WE11BSTWSSWD8B","imagera-media","Generate or edit images, video clips, voiceovers and music through the hosted Imagera MCP server, quoting the credit cost and getting approval before each paid call.","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-imagera-media\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-imagera-media\u002FSKILL.md",[],[],{"skillNo":122,"name":123,"nameZh":6,"description":124,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":125,"sourceHtmlUrl":126,"categories":127,"keywords":128,"publishedAt":104},"01M743HDJNZQA8A4VT68NWGWQJ","deja-history","Search this machine's past AI coding sessions across Claude Code, Codex, Cursor, Gemini CLI and thirty-nine other agents before editing, debugging, or denying something exists.","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-deja-history\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-deja-history\u002FSKILL.md",[],[]]