项目作者: befabri

项目描述 :
A keywords ssh connection
高级语言: Python
项目地址: git://github.com/befabri/ssh-keyword.git
创建时间: 2020-02-04T20:28:34Z
项目社区:https://github.com/befabri/ssh-keyword

开源协议:MIT License

下载


ssh-keyword

A CLI tool for managing SSH connections via keywords.

Example

Your ssh host is 192.168.1.250.

  1. $ ssh-keyword -a 192.168.1.250
  2. Entry for new connection
  3. Enter 'quit' for exit
  4. Enter a user: john
  5. Port: 22
  6. Enter a list of names separate by ',': server, john
  7. Default server ([Y]es | [N]o): no
  8. $ ssh-keyword -ls
  9. ip:192.168.1.250 user:john port:22 keywords:['server', 'john'] default:False
  10. $ ssh-keyword server

You are now connected to 192.168.1.250 !

Installation

Windows

To install on Windows, download the latest .exe file from the GitHub releases and add the directory containing ssh-keyword.exe to your environment path to access it from anywhere.

Linux

To install ssh-keyword on Linux, follow these steps:

  1. Download the latest release from the GitHub repository:
    1. wget https://github.com/befabri/ssh-keyword/releases/download/v1.2.2/ssh-keyword-linux-amd64
  2. Make the executable accessible:
    1. chmod +x ssh-keyword-linux-amd64
  3. Move the executable to a bin directory:
    1. sudo mv ssh-keyword-linux-amd64 /usr/local/bin/ssh-keyword
  4. Verify the installation by checking the version or help:
    1. ssh-keyword -h

Documentation

First add your connection with ssh-keyword -a [IP].\
Now you can connect to your ssh host by typing ssh-keyword [YOUR_KEYWORD] or just ssh-keyword if you have set a default connection.

Help

  1. $ ssh-keyword -h
  2. Usage: ssh-keyword [keyword]
  3. ssh-keyword [options] [command]
  4. Options:
  5. -a, --add [IP] Add a connection using the specified IP address.
  6. -d, --default [IP] Set the specified IP as the default connection.
  7. -rm, --remove [IP] Remove the connection with the specified IP.
  8. -ls, --list [IP] List all connections or a specific connection by IP.
  9. -e, --edit [IP] Edit the connection with the specified IP.
  10. -h, --help Show this help message and exit.
  11. Examples:
  12. ssh-keyword Connects to the default connection.
  13. ssh-keyword server Connects to the connection labeled 'server'.
  14. ssh-keyword 192.168.1.1 Connects to 192.168.1.1.
  15. ssh-keyword --default 192.168.1.1 Sets 192.168.1.1 as the default connection.
  16. ssh-keyword --add 192.168.1.1 Add a connection for 192.168.1.1.
  17. ssh-keyword --remove 192.168.1.1 Remove the connection for 192.168.1.1.
  18. ssh-keyword --list List all connections.
  19. ssh-keyword --edit 192.168.1.1 Edit the connection for 192.168.1.1.
  20. ssh-keyword --help Show the help message.