Skip to content

Instantly share code, notes, and snippets.

@nrollr

nrollr/SSHKeys.sh

Last active Oct 2, 2019
Embed
What would you like to do?
Generate SSH keys
#!/bin/bash/
ls -al ~/.ssh # Lists existing files in your .ssh directory
ssh-keygen -t rsa -b 4096 -C "your_email@domain.com" # Creates new ssh key, using the provided email as label
eval "$(ssh-agent -s)" # Ensure ssh-agent is enabled
ssh-add ~/.ssh/id_rsa # Add ssh key to the ssh-agent
@ghost

This comment has been minimized.

Copy link

@ghost ghost commented Aug 6, 2016

Hi, I find this command also very helpful: pbcopy < ~/.ssh/id_rsa.pub
It lets you add your generated key to the clipboard, if you like to paste it in somewhere quick.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment