Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can avoid specifying a lot of parameters at each SSH connection by defining aliases, e.g. of the form ssh-servername.

In each alias you put the appropriate "-i private_key_for_that_server", the server name and also "-l user_name" if you have a different user there and "-p port" if the server uses a non-standard port.

Thus, after the initial key setup, connecting to any server with different credentials is no more complex than when using a single key pair.

Except for an extra keygen step, the initial setup is not more complex than when using a single key pair, as you have to copy the public keys anyway, which is the more difficult part of the setup.



You might want to look into using .ssh/config instead, as it is built into SSH. In addition to letting you specify keys/usernames for arbitrary hosts, you can also use rules for wildcards, etc.


Shell completion over ssh is one of the really nice benefits of sshconfig. I’m not sure if this is zsh specific though


It’s definitely not, I use bash and completion works great. I’d be surprised if there was a major shell that was not supported.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: