Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dbrady/ssh-config
A Tool to help manage your .ssh/config file.
https://github.com/dbrady/ssh-config
Last synced: about 1 month ago
JSON representation
A Tool to help manage your .ssh/config file.
- Host: GitHub
- URL: https://github.com/dbrady/ssh-config
- Owner: dbrady
- License: mit
- Created: 2010-03-27T03:39:02.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2020-12-29T20:14:28.000Z (almost 4 years ago)
- Last Synced: 2024-05-01T12:50:45.785Z (8 months ago)
- Language: Ruby
- Homepage:
- Size: 30.3 KB
- Stars: 126
- Watchers: 6
- Forks: 18
- Open Issues: 0
-
Metadata Files:
- Readme: README.rdoc
- Changelog: CHANGES
- License: MIT-LICENSE
Awesome Lists containing this project
- awesome-ssh - ssh-config - config.svg?style=social&label=stars)](https://github.com/dbrady/ssh-config) - A tool to help manage your `.ssh/config` file. (Apps / `.ssh/config`)
- awesome-ssh - ssh-config - config.svg?style=social&label=stars)](https://github.com/dbrady/ssh-config) - A tool to help manage your `.ssh/config` file. (Apps / `.ssh/config`)
README
= ssh-config: A Tool for Managing ssh Config Files
== Overview
It's not THAT much trouble to update your .ssh/config file every time
a host changes, but when it starts happening often enough, even that
hassle starts to add up. This is a quick tool I wrote to help handle
them.It takes great care to not trash your config file, so you can continue
to edit your config files by hand before and after running the tool.ssh-config will make a backup of your ~/.ssh/config file as
~/.ssh/config~.Probably the most useful command is "copy", which intelligently copies
an existing host section.== Commands
=== set
Adds or updates the value for a given host.
=== unset
Removes a key value for a given host. NOTE: If all values are removed
from a section, the section is NOT removed; use rm for that.=== rm
Removes an entire host section.
=== copy [ [...]]
Copies the entire section named to a new section called
. If old_host has a Hostname section, ssh-config will try to
update it to reflect the new_host name. For example, if you had a
section likeHost rails01
Hostname rails01.example.comAnd you did ssh-config copy rails01 rails02, the new section would
look like this:Host rails02
Hostname rails02.example.comYou can manually override any setting, and/or set new ones by
appending the new key/value pairs at the end. Given the rails01
section above, "ssh-config copy rails01 rails02 Hostname
rails-02.example.com User dbrady" would emitHost rails02
Hostname rails-02.example.com
User dbradyNote: If you just want another short name for a host, use alias instead
=== dump
Dumps the entire file.
=== show [ ...]
Dumps one section. (Similar to ssh-what.) may be the main name
for a host or an alias.=== search
Shows all sections that have any line (key OR value) that matches
pattern. (Similar to ssh-what.)=== list
Lists all section names (just the Host line)
=== alias [ ...]
Adds one or more aliases to a host definition (to show up on the Host line).
=== unalias [] [ ...]
With 2 or more arguments, looks up host by (must be the first
name on the Host line), and removes any es from the list of
alternate names. With only 1 argument, looks for an entry by that
alias (must NOT be the first name on the Host line), and removes the
alias from the entry, if found.