This script provides a user-friendly dialog-based interface for connecting to SSH hosts defined in your SSH config file. It automatically reads available hosts from ~/.ssh/config and presents them in an interactive menu for easy selection.
- Interactive dialog-based user interface
- Automatically reads and parses SSH hosts from
~/.ssh/config - Displays a numbered menu of available SSH connections
- Sorts hosts alphabetically for easy navigation
- Clean and simple selection process
- Linux/Unix-based operating system
- Bash shell
dialogpackage installed- Properly configured
~/.ssh/configfile - SSH client
On Debian/Ubuntu systems:
sudo apt-get install dialog-
Enable Auto-Completion in Bash
echo 'complete -W "$(awk "/^Host[[:space:]]+[^*]/ {print \$2}" ~/.ssh/config)" ssh' >> ~/.bashrc source ~/.bashrc
-
To Connect via SSH UI
apt install dialog
-
Make the script executable:
chmod +x ssh-ui-script
-
Run the script:
./ssh-ui-script
If you want to access the SSH UI from anywhere in your system without executing the script manually, you can create a system-level command.
-
Create a symbolic link to make the script accessible system-wide:
sudo ln -s "$(pwd)/ssh-ui-script" /usr/bin/ui-ssh -
Now you can launch the SSH UI from anywhere using:
ui-ssh
This allows you to quickly access your SSH connections menu from any directory without typing the full script path.
The script automatically reads from your SSH config file (~/.ssh/config). Ensure your SSH config file is properly formatted with host entries like:
Host hostname1
HostName example1.com
User username1
Host hostname2
HostName example2.com
User username2
