Subversion Repositories sysadmin_scripts

Rev

Blame | Last modification | View Log | Download | RSS feed

This is a reversable set of scripts. You can read an existing ssh config
script in via getsshinfo.pl, pass the output to makessh_config and,
in theory, get the same functioning configuration back. However, the
order will be changed.

Example: grab a personal config file, and send the rewritten result to
less

./getsshinfo.pl < ~/.ssh/config | ./makessh_config.pl | less

WARNING: Expects a file containing nothing but host blocks, ie
host myname
hostname = actual.url
port=22
user me

host=another.name
hostname 127.0.0.1
# port and user left as defaults

Anything else is ignored EXCEPT see below, so more complex configurations may
get totally barfed up. Especially /etc/ssh/ssh_config. You should manually
cut/paste.

It will ignore anything until it finds a line matching the regex
^host[= ]+([a-z0-9.-]+)$