April 8, 2019

116 words 1 min read

SSH and Keys

Adding keys to the current ssh agent

Creating a key

To create a key we use the command ssh-keygen

ssh-keygen -t rsa -b 4096 -f your-key-name -C youremail@example.com

Updating your bash profile

To ensure the keys are loaded when the terminal program is started, you will want to update your bash profile to start the ssh agent first:

eval "$(ssh-agent -s)"

And to load every key you want by default:

ssh-add ~/.ssh/your-key-name

Remoting into a Digital Ocean server

With the keys in place and registered in the DO console, to get to the machine you will need to add the user in the resquest:

ssh root@0.0.0.0

Publishing with rsync

hugo && rsync -avz --delete public/ root@0.0.0.0:~/www/