Setup
- Download and install cygwin with the openssh and the keychain package
- Run cygwin
- Enter in the terminal:
- ssh-keygen -t rsa
- choose some password, and enter it again to confirm
- vi ~/.bashrc and put this at the button of the file:
source ~/.keychain/${HOSTNAME}-sh
Usage
To get be able to log in to the remote machine, simply append the contents of your local ~/.ssh/id_rsa.pub to ~/.ssh/authorized_keys on the remote machine (create the file on the remote machine if it does not exist). *If the authorized_keys file doesn't exist, create it and make sure that the permission is at least 700!
Config
If you typically ssh using another user, or want to setup an alias to be able to quickly ssh somewhere, you can configure ssh to do this. Simply vi ~/.ssh/config (create the file if it doesn't exist) and model your entries after the following:
Host server
Hostname server.fully.qualified.name
User admin
Now to be able to ssh into server.fully.qualified.name as the admin user, simply type in:
ssh server
whereas before you had to type inssh admin@server.fully.qualified.name