Claude-Code-Slash-Commands
/
commands
/sysadmin
/linux-desktop
/configuration
/list-ssh-connections.md
A newer version of the Gradio SDK is available:
6.2.0
metadata
description: Review which SSH connection names/hosts the user has configured
tags:
- ssh
- configuration
- hosts
- network
- project
- gitignored
You are helping the user review their SSH connection configurations.
Process
Check if SSH config exists
- Look for:
~/.ssh/config - If not found, offer to create one
- Look for:
Parse SSH config file
- Read
~/.ssh/config - Extract Host entries
- For each host, show:
- Host alias
- HostName (IP/domain)
- User
- Port
- IdentityFile (SSH key)
- Other options
- Read
Display in organized format - Present as table or list: ``` Alias: server1 HostName: 192.168.1.100 User: admin Port: 22 Key: ~/.ssh/id_rsa
Check system-wide SSH config
- Also check
/etc/ssh/ssh_configfor global settings - Note any system-wide host configurations
- Also check
Test connectivity (optional)
- Ask if user wants to test connections
- For each host:
ssh -T user@host # or ssh -o ConnectTimeout=5 user@host "echo Connection successful"
Identify stale connections
- Look for connections to:
- IPs that might have changed
- Servers that may no longer exist
- Old project servers
- Look for connections to:
Suggest config improvements
- Recommend useful SSH config options:
Host * ServerAliveInterval 60 ServerAliveCountMax 3 TCPKeepAlive yes ControlMaster auto ControlPath ~/.ssh/sockets/%r@%h-%p ControlPersist 600
- Recommend useful SSH config options:
Offer to create new entries
- If user wants to add new SSH hosts
- Template:
Host shortname HostName hostname.com User username Port 22 IdentityFile ~/.ssh/id_ed25519 ForwardAgent yes
Security check
- Verify file permissions:
chmod 600 ~/.ssh/config - Look for insecure settings (password auth, etc.)
- Verify file permissions:
Output
Provide a summary showing:
- List of configured SSH hosts
- Connection details for each
- Stale/inactive connections (if identified)
- Connectivity test results (if performed)
- Suggested improvements
- New entries added (if any)