Giter Club home page Giter Club logo

manssh's Introduction

manssh

Build Status Go Report Card GoCover.io GoDoc DUB

manssh is a command line tool for managing your ssh alias config easily, inspired by storm project, powered by Go.

Feature

  • No dependence.
  • Add, list, query, delete ssh alias record.
  • Backup ssh config.

Install

Gopher

go get -u github.com/xwjdsh/manssh/cmd/manssh

Homebrew

brew tap xwjdsh/tap
brew install xwjdsh/tap/manssh

Docker

alias manssh='docker run -t --rm -v ~/.ssh/config:/root/.ssh/config wendellsun/manssh'

Manual

Download it from releases, and extract it to your PATH directory.

Usage

% manssh
NAME:
   manssh - Manage your ssh alias configs easily

USAGE:
   manssh [global options] command [command options] [arguments...]

VERSION:
   master

COMMANDS:
     add, a     Add a new SSH alias record
     list, l    List or query SSH alias records
     update, u  Update SSH record by specifying alias name
     delete, d  Delete SSH records by specifying alias names
     backup, b  Backup SSH alias config records
     help, h    Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --file value, -f value  (default: "/Users/wendell/.ssh/config")
   --help, -h              show help
   --version, -v           print the version

Add a new alias

# manssh add test2 2.2.2.2
# manssh add test1 [email protected]:77 -c IdentityFile=~/.ssh/wendell
% manssh add test1 [email protected]:77 -i ~/.ssh/wendell
✔ alias[test1] added successfully.

        test1 -> [email protected]:77
                identityfile = /Users/wendell/.ssh/wendell

Username and port config is optional, the username is current login username and port is 22 by default.
Using -c to set more config options. For convenience, -i xxx can instead of -c identityfile=xxx.

List or query alias

# manssh list
# manssh list "*"
# manssh list Test -ic
% manssh list test1 77
✔ Listing 1 records.

        test1 -> [email protected]:77
                identityfile = /Users/wendell/.ssh/wendell

It will display all alias records If no params offered, or it will using params as keywords query alias records.
If there is a -it option, it will ignore case when searching.

Update an alias

# manssh update test1 -r test2
# manssh update test1 [email protected]:22022
% manssh update test1 -i "" -r test3 -c hostname=3.3.3.3 -c port=22022
✔ alias[test3] updated successfully.

        test3 -> [email protected]:22022

Update an existing alias record, it will replace origin user, hostname, port config's if connected string param offered.
You can use -c to update single and extra config option, -c identityfile= -c proxycommand= will remove identityfile and proxycommand options.
For convenience, -i xxx can instead of -c identityfile=xxx
Rename the alias specified by -r flag.

Delete one or more alias

# manssh delete test1
% manssh delete test1 test2
✔ alias[test1,test2] deleted successfully.

Backup ssh config

% manssh backup ./config_backup
✔ backup ssh config to [./config_backup] successfully.

Thanks

Licence

MIT License

manssh's People

Contributors

timothyye avatar trigged avatar xwjdsh avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.