Skip to content

hollson/remote-hosts

Repository files navigation

Remote Hosts

PyPI Version Python Versions SSH Protocol Remote Management License Stars Lightweight
A lightweight and efficient SSH remote host management tool that makes your remote connections simpler and more convenient
English | 中文

📦 Installation

Install from PyPI (recommended)

pip install remote-hosts

Install from source

# Clone the repository
git clone https://github.com/hollson/remote-hosts.git
cd remote-hosts

# Build and install
pip install build
python -m build
pip install --force-reinstall dist/remote_hosts-*.whl

Installation verification

remote-hosts -v
pip show remote-hosts

Uninstall

pip uninstall remote-hosts -y
rm $HOME/.remote_hosts.json

🎯 Usage Examples

  • Display help information
$ remote-hosts -h
==============================================
        SSH Remote Host Management Tool        
==============================================

usage: remote-hosts [-h] [-v] [-e [editor]]

options:
  -l, --list      View host list
  -e [editor]     Edit configuration file
  -m, --manual    View operation guide
  -v, --version   Display version information
  -h, --help      Display help information
  • Login to remote host
$ remote-hosts
┌──────────┬───────────────┬──────────┬───────────────┬──────────┬───────────┬───────────┐
│    ID    │     Host      │   User   │      OS       │   Arch   │  Region   │   Mark    │
├──────────┼───────────────┼──────────┼───────────────┼──────────┼───────────┼───────────┤
│1         │example.com    │root      │ubuntu22.04    │x86_64    │New York   │example    │
├──────────┼───────────────┼──────────┼───────────────┼──────────┼───────────┼───────────┤
│2         │192.168.1.1    │root      │       -       │    -     │     -     │example    │
└──────────┴───────────────┴──────────┴───────────────┴──────────┴───────────┴───────────┘
Please enter host ID (q to exit): 1
Connecting to root@example.com:22...
  • Edit configuration file
$ remote-hosts -e
Please select text editor:
  1. default    System default text editor
  2. vi         Vi editor
  3. vim        Vim editor
  4. nano       Nano editor
  5. code       Visual Studio Code
Please enter option number: 

⚙️ Configuration Example

The configuration file is located at ~/.remote_hosts.json in JSON format. A sample configuration file will be automatically created when running for the first time.

[
	{
		"id": 1,
		"host": "example.com",
		"port": 22,
		"user": "root",
		"key": "~/.ssh/id_rsa",
		"os": "ubuntu22.04",
		"arch": "x86_64",
		"region": "Beijing",
		"mark": "example"
	},
	{
		"id": 2,
		"host": "192.168.1.1",
		"user": "root",
		"mark": "example"
	}
]

📄 License

This project is licensed under the MIT License - see the LICENSE file for details

About

A lightweight and efficient SSH remote host management tool

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors