I manage a handful of servers across client environments. Some use key auth, some use passwords, and most of the time I need root access once I'm in. The workflow was always the same: scroll through terminal history for the right ssh command, type the password, then sudo -i and type it again.
I built SSHM to skip all of that. It's a terminal app that stores server credentials, keeps passwords in macOS Keychain, and optionally elevates to root automatically after login. One keypress to connect.
Install
pipx install sshm-terminal
If you don't have pipx:
brew install pipx && pipx ensurepath
Or via Homebrew directly:
brew tap dailydeploy365/tap && brew install sshm
Add a server
Launch with sshm, press a to open the add form:
Name: Production API
Host / IP: 192.168.1.50
Port: 2222
User: deploy
Group: production
Password: ••••••••
SSH Key Path: (leave empty if using password)
☑ Auto sudo (elevate to root)
Press ctrl+s to save. The password goes straight into macOS Keychain. Server metadata is stored in ~/.sshm/servers.json with no secrets in it.
Connect
Select the server with arrow keys and press Enter. That's it.
If you checked "Auto sudo," the app SSHs in, waits for the shell prompt, runs sudo -i, handles the password prompt, and drops you into a root shell. You don't type the password at all.
How the password security works
Passwords never touch disk as plaintext. The macOS security CLI writes them to Keychain with a service tag of sshm. You can verify in Keychain Access.app by searching for "sshm."
During connection: when sshpass is available, the password is passed through an environment variable (SSHPASS), which never hits a file. When falling back to expect, a temp file with 0400 permissions is created, the expect script reads it, deletes it immediately, then handles the SSH prompt. Cleanup happens in a finally block.
Auto-sudo in detail
The auto-sudo feature chains two expect sequences:
- SSH into the server and send the password at the login prompt
- Wait for the shell prompt (looks for
user@host:...$) - Send
sudo -i - Send the same password at the sudo prompt
- Hand control to you with
interact
This assumes the SSH user has sudo privileges and that the sudo password matches the SSH password. That's the common setup for most cloud VMs.
Keyboard shortcuts
-
aAdd a new server -
eEdit selected server -
dDelete selected server -
EnterSSH into selected server -
cCopy SSH command to clipboard -
/Search and filter servers -
qQuit
SSH keys
Leave the Password field empty and fill in the SSH Key Path:
SSH Key Path: ~/.ssh/id_rsa
The app uses ssh -i when connecting. No expect scripts, no sshpass.
Requirements
- macOS (uses the
securityCLI for Keychain andexpectfor password automation) - Python 3.10+
This is macOS-only because of the Keychain dependency. Linux support (via secret-tool or pass) isn't built yet.
Links
- GitHub
- Install:
pipx install sshm-terminal - Full writeup on dailydeploy.in
If you manage multiple servers and want a cleaner workflow, give it a try. Feedback and PRs welcome.
Top comments (0)