Below is the way I connect to a remote server via SSH keys generated on OSX.
Setting up a server
When you set up an Ubuntu server on Vultr (read my guide on setting up a Vultr server for as low as $2.5 a month) or Digital Ocean (use this link to get two months free when you setup an Ubuntu server on digital ocean) you can specify an SSH key to use for remote connections during the server create stage (old guide here).
How to create an SSH key on OSX to use to connect to a remote server
Run the following command (“sudo ssh-keygen -t rsa“) to generate an ssh key paid in “~/.ssh/” on OSX.
TIP: It is a good idea to also generate a passphrase to use with the key (double protection). You will be prompted to enter this password to use the RSA key.
You can now see the generated keys in ~/.ssh/
You can view the contents of the public file (you can use this when generating Digital Ocean, Vultr, AWS or Azure or other cloud servers).
fyi: Replace 123.123.123.123 with your remote serves ip.
How to connect to a server (the old way).
As long as your host added the desired public ssh key file contents to the server (adding the public ssh key contents to “~/.ssh/authorized_keys” you will be able to connect to the server.
Run the following command on OSX command line to connect to the server via SSH.
You should see..
Congratulations, you should now be able to connect to your server via SSH.
Securing your ubuntu Server
Read my guides here, here and here.
Don’t forget to add a firewall and set up an SSL certificate.
How to connect to a server (faster way).
todo: ~/.ssh/config method
Now we can connect to your remote server with the shorter method.
todo: ~/.ssh/config method
Donate and make this blog better
Ask a question or recommend an article
[contact-form-7 id=”30″ title=”Ask a Question”]
Revision History
v1.0 Initial Post
etc