SSHMenu is a command-line tool that allows you to manage and connect to your SSH hosts conveniently. You can add new hosts, toggle address visibility, and select hosts to establish SSH connections.
- Add new SSH hosts by providing the name, username, address, and port.
- Toggle address visibility to obfuscate or reveal the host addresses.
- Select a host from the list to establish an SSH connection.
- Python 3.x
- pip package manager
- Clone the repository:
git clone https://github.com/athphane/sshmenu.git
- Navigate to the project directory
cd sshmenu
- Install the required dependencies
pip install -r requirements.txt
To run the SSH Host Management tool, use the following command:
python main.py [--add] [--toggle] [--filter TAG]
--add
: Add a new host interactively.--toggle
: Toggle address visibility for a host.--filter TAG
: Filter hosts by the specified tag.
Note: If no options are provided, the tool will display a list of hosts for selection.
The script will look for the hosts.json file in a "sensible default" location, which is the user's SSH config folder.
Here's the full path to it: ~/.ssh/hosts.json
The hosts are stored in a JSON file named hosts.json
. You can manually edit this file to add or modify hosts.
Each host object should have the following attributes:
name
: The name of the host.username
: The SSH username for the host.address
: The IP address or hostname of the host.port
: The SSH port number for the host.tags
(optional): A list of tags associated with the host.
Here's an example of the JSON structure:
{
"hosts": [
{
"name": "Example Host",
"username": "user",
"address": "192.168.0.1",
"port": 22,
"tags": [
"tag1",
"tag2"
]
},
...
]
}
- Add a new host:
python main.py --add
- Toggle address visibility for a host
python main.py --toggle
- Filter hosts by a tag
python main.py --filter tag1
PyInstaller is a popular tool for creating standalone executables from Python applications. Follow the steps below to build the executable for SSHMenu.
- Run the helper script to do it automatically
.\build.bat
This will run the script, activate your virtual environment and compiles an EXE of SSHMenu.
The compiled EXE will be in the /dist folder of the project. You can move it to a different folder in your system, or to a folder that is added to your PATH, which will let you use the exe from anywhere on your system.
Contributions are welcome! If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request.
This project is licensed under the MIT License