Skip to content

Latest commit

 

History

History
47 lines (35 loc) · 1.09 KB

README.mkd

File metadata and controls

47 lines (35 loc) · 1.09 KB

rubbissh is a ruby script that generates a ssh config file from a YAML definition.

Installation

  • Copy rubbissh.rb and config.yml in your ~/.ssh/ folder.
  • Edit config.yml to suit your needs.
  • Run rubbissh.rb to generate your config file.

I use an alias for quick refreshes: alias rubbissh="$(which ruby) ~/.ssh/rubbissh.rb"

Example config

config.yml

*:
  server_alive_interval: 30
  server_alive_count_max: 120

dev-:
  *:
    user: bobby
    port: 1221

  website: my-web-host.com
  database:
    host_name: my-db-host.com
    identity_file: ~/ident.key

config.out

Host *
	ServerAliveCountMax	120
	ServerAliveInterval	30
Host dev-*
	User	bobby
	Port	1221
Host dev-database
	HostName	my-db-host.com
	IdentityFile	~/ident.key
Host dev-website
	HostName	my-web-host.com

Config details

  • Use the * wildcard to define keywords for all machines under the current level.
  • Use the - symbol after a machine name to create a server group.
  • By default, rubbissh generates a config.out file. Edit rubbissh.rb to customize the output path.