sshm-rs is a cross-platform CLI tool designed to manage SSH connections, offering an integrated terminal and SFTP browser for seamless remote access. Built in Rust, it provides a fast, secure, and efficient way to handle SSH operations.
Secure Credentials: Utilizes OS-native keyring for safe storage of passwords and keys.
Integrated SFTP Browser: Supports file transfers with progress tracking and directory navigation.
Tags & Groups: Organize servers efficiently using tags and groups for quick access.
Audience & Benefit:
Ideal for developers, system administrators, and IT professionals who require efficient SSH management. It streamlines workflows by enabling port forwarding, command snippets, and multi-host operations, enhancing productivity and reducing manual tasks.
Installable via winget, it supports Windows, Linux, and macOS, ensuring cross-platform compatibility.
# Interactive TUI
sshm-rs
# Direct connection to a host
sshm-rs myhost
# Execute command on remote host
sshm-rs myhost "ls -la /tmp"
# Execute with pseudo-TTY
sshm-rs myhost -t "sudo -s"
# Search mode (focus on search)
sshm-rs --search
# Use alternate SSH config
sshm-rs --config /path/to/config
sshm-rs Subcommands
# Add a new host interactively
sshm-rs add
# Edit an existing host
sshm-rs edit myhost
# Search hosts and display results
sshm-rs search "database"
# Export hosts to JSON
sshm-rs export --output hosts.json
# Import hosts from JSON
sshm-rs import hosts.json [--skip-duplicates]
# Validate SSH config for warnings
sshm-rs validate
# Generate shell completions
sshm-rs completions bash > sshm-rs.bash
sshm-rs term (SSH Terminal)
The term subcommand launches an SSH terminal with integrated SFTP browser. You can access it from sshm-rs with the W key or run it directly:
# SSH terminal with SFTP browser
sshm-rs term user@host
# Connect to specific port
sshm-rs term user@host --port 2222
# Use specific key
sshm-rs term user@host --key ~/.ssh/id_rsa
# Prompt for password
sshm-rs term user@host --password
Keybindings
sshm-rs Keybindings
Navigation & Connection
Key
Action
j / Down
Move down
k / Up
Move up
PgUp
Page up
PgDn
Page down
Home
Jump to first host
End
Jump to last host
/
Search hosts
Tab
Switch focus (search ↔ host list)
Enter
Connect to selected host
Multi-Select
Key
Action
Space
Toggle select host, move down
Ctrl+a
Select all visible hosts
d
Delete all selected hosts
b
Broadcast command to selected hosts
Esc
Clear selection
Host Management
Key
Action
a
Add new host
e
Edit selected host
d
Delete selected host
p
Set/remove password for host
f
Toggle favorite
F
Setup port forwarding
i
Show host info
s
Toggle sort mode
y
Copy host to clipboard
t
Toggle tag sidebar
r
Refresh connectivity status
T
Cycle color theme
S
Show command snippets
G
Create new group
g
Assign host to group
Enter
Collapse/expand group (on group header)
File Transfer
Key
Action
x
Quick SFTP session
X
SCP file transfer
W
Open with sshm-rs term (terminal + SFTP)
System
Key
Action
? / h
Show keybindings
q
Quit
sshm-rs term Keybindings
Global
Key
Action
Ctrl+q
Quit
Ctrl+s
Switch panel (Terminal ↔ SFTP)
Ctrl+b
Toggle SFTP panel visibility
Ctrl+f
Toggle SFTP directory follow mode
Ctrl+p
Show snippets overlay
Terminal Panel
Key
Action
Any key
Send to terminal (when focused)
Ctrl+s
Switch to SFTP panel
SFTP Panel
Key
Action
j / Down
Move down
k / Up
Move up
Enter
Open folder or file
Backspace
Go to parent directory
/
Edit current path
e
Edit file (launches local editor)
d
Download file
u
Upload file
a
Add snippet from file
Right-click
Context menu (edit, download, open, go up, refresh, zip, etc.)
Context Menu
Action
Description
Edit
Edit file with local editor
Download
Download to local machine
Upload
Upload file to this location
Open Folder
Navigate into folder
Go Up
Navigate to parent directory
Refresh
Refresh directory listing
Zip
Compress file/directory
Download as ZIP
Compress and download
Delete
Delete remote file/directory
Snippet Overlay
Key
Action
j / Down
Move down
k / Up
Move up
Tab / Right
Next field in editor
Shift+Tab / Left
Previous field in editor
Enter
Save and execute snippet
Esc
Cancel
Configuration
SSH Config Parsing
sshm-rs reads from ~/.ssh/config (or %USERPROFILE%\.ssh\config on Windows) with full support for:
Tags via # Tags: tag1, tag2 comments above Host entries
Multi-alias hosts (multiple space-separated names per Host block)
Example SSH config:
# Tags: production, web
Host webserver web
Hostname 192.168.1.100
User ubuntu
Port 22
IdentityFile ~/.ssh/web.pem
# Tags: development
Host devenv
Hostname dev.example.com
User dev
ProxyJump bastion
Host bastion
Hostname jump.example.com
User ops
sshm Configuration
Configuration files are stored in:
Linux/macOS: ~/.config/sshm-rs/
Windows: %APPDATA%\sshm-rs\
Snippets
Save command snippets in snippets.json:
[
{
"name": "Check Disk Space",
"command": "df -h",
"description": "Show disk usage"
},
{
"name": "List Processes",
"command": "ps aux | grep",
"description": "Find process by name"
}
]
Accessed via S in sshm-rs or Ctrl+P in sshm-rs term.
Connection history is stored in history.json and automatically updated each time you connect to a host.
Credential Storage
Passwords and credentials are stored securely using the OS keyring:
Linux — Uses secret-service (GNOME Keyring, KDE Wallet, etc.)
macOS — Uses Keychain
Windows — Uses Credential Manager
Set a password for a host with p in the host list, then sshm-rs will use it automatically on future connections.
Security
Trust on First Use (TOFU)
sshm-rs term implements TOFU for SSH host key verification:
First connection to a new host automatically trusts the server key (TOFU)
Key mismatches are rejected with a warning
Password Handling
Passwords are stored in the OS keyring, never in plaintext
Keyring access requires user authentication (password, biometric, etc.)
Environment variable SSHM_PASSWORD can be set for automation (cleared after use)
SSH Key Management
Public key authentication is preferred over password authentication
Supports OpenSSH and PuTTY-format private keys
SSH agent integration (via SSH_AUTH_SOCK)
Per-host identity file configuration
CLI Flags
USAGE:
sshm-rs [FLAGS] [OPTIONS] [HOST] [COMMAND]...
FLAGS:
-h, --help Print help
-t, --tty Force pseudo-TTY allocation
-s, --search Focus on search at startup
OPTIONS:
-c, --config SSH config file (default: ~/.ssh/config)
SUBCOMMANDS:
add Add new SSH host
edit Edit SSH host
search Search hosts
export [--output FILE] Export hosts to JSON
import Import hosts from JSON
validate Validate SSH config
completions Generate shell completions
Development
Build Requirements
Rust 1.70+
OpenSSL development headers (Linux)
macOS: Xcode command-line tools
Build
cargo build --release
Run Tests
cargo test
Troubleshooting
sshm.exe locked on Windows
If sshm-rs.exe is locked after execution:
Press Ctrl+C to terminate the running process
Close any open SSH connections
Retry the command
SFTP unavailable
If sshm-rs term shows "SFTP unavailable":
Ensure the remote server has /usr/lib/sftp-server or equivalent
Some restricted shells or environments may not support SFTP
Check server logs for SFTP subsystem errors
Host key changed warning
If sshm-rs term warns "host key changed":
Verify the server hasn't been compromised
If you know the host key changed (server maintenance), remove the entry from ~/.ssh/known_hosts
Reconnect to accept the new key
Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
Fork the repository
Create your feature branch (git checkout -b feature/amazing-feature)