Contents of useful ~/.ssh/config:
# Set this to share connection between terminals ControlMaster auto ControlPath /tmp/ssh_mux_%h_%p_%r # Time to hold connection ControlPersist 6h Host www* mail db # Hostname to ssh in HostName %h.example.com # Username to login with User developer
Login without password input:
Copy your ~/.ssh/idrsa.pub -> ~/.ssh/authorizedkeys:
$ ssh-copy-id firstname.lastname@example.org
$ < ~/.ssh/id_rsa.pub ssh mail 'mkdir -p .ssh; cat >> .ssh/authorized_keys; chmod go-w .ssh .ssh/authorized_keys'
Now you can:
$ ssh www1 $ ssh db