Two years ago Felipe Coury submitted a pull request to add
ghost-ssh to manipulate
~/.ssh/config files. If it weren't for Google pointing me to this pull request, I would have never known
ghost-ssh existed. The readme says nothing about it!
This is what Felipe had to say when he submitted his patch:
I had a need to manipulate ~/.ssh/config file the same way I can manipulate my hosts entries, so I made this change.
Not sure if it will be useful for the upstream project, but be welcome to merge if you like.
An intro to ghost-ssh
Just like with
ghost on the command line,
ghost-ssh has basic
delete options, as well as an
import operation to import files.
To save you some time, here's the contents of
$ ghost-ssh --help USAGE: ghost-ssh add <host> <hostname> [--user=<user>] [--port=<port>] ghost-ssh modify <host> <hostname> [--user=<user>] [--port=<port>] ghost-ssh delete <host> ghost-ssh list ghost-ssh empty ghost-ssh export ghost-ssh import <file>
An example of adding a new entry to your
ssh/config might look something like this:
$ ghost-ssh add tclprod xxxxxx.gridserver.com --user=tcladmin [Adding] tclprod -> xxxxxx.gridserver.com
You can confirm the entry was added to
ssh/config by running the
ghost-ssh list command:
$ghost-ssh list Listing 1 configs(s): tclprod -> email@example.com:22
Now that I have this new entry in place, I can easily ssh into the server by running
ssh tclprod and boom goes the dynamite!
Checkout the source for Ghost on GitHub for install and usage details.
Discuss on Hacker News if you'd like.