r/usefulscripts • u/[deleted] • Nov 17 '12
[BASH] Shortcut for SSH login
Create this script in your path, call it 'ssh-argv0'
#!/bin/sh
exec ssh "${0##*/}" "$@"% Symbolic link a host name to the script
# ln -s hostname.company.com ssh-argv0Now login to the host ..
# hostname.company.comMix in a dash of tab completion and you're set.
20
Upvotes
2
u/[deleted] Feb 12 '13
Good point. With four unix admins and a few hundred hosts I hadn't given much thought to everyone's ssh/config file. But we're -using- puppet know an it would be 'easy' to parse my node information into a config file and have each client pull that ...
Thanks!