Created
October 9, 2015 13:38
-
-
Save ueokande/cfd925f6749f71886096 to your computer and use it in GitHub Desktop.
Generate SSH config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/ruby | |
def add_host(host, options = {}) | |
puts "Host #{host}" | |
options.each do |k, v| | |
puts "#{k} #{v}" | |
end | |
puts | |
end | |
add_host 'git', hostname: 'git.example.com', user: 'git' | |
add_host 'web', hostname: 'web.example.com', port: 11111, user: 'admin' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Init as
mkfifo ~/.ssh/config
and use as in .bashrc