Managing SSH Keys

cd ~/.ssh
ssh-keygen -t rsa -b 2048 -C "[email protected]"
id_rsa_provider_username

# update key with ssh-keygen -p -f ./id_rsa_provider_username

ssh -T [email protected] # reply yes

# add key to local system

eval "$(ssh-agent -s)" # check the service is running
ssh-add ~/.ssh/id_rsa_provider_username

# add to the ~/.ssh/config
# https://linux.die.net/man/5/ssh_config

Host provider.com_username
	HostName provider.com
	Preferredauthentications publickey
	IdentityFile ~/.ssh/id_rsa_provider_username

# copy key
pbcopy < ~/.ssh/id_rsa_provider_username.pub

# for gitlab
# settings > SSH Keys
# paste in key and give name

# for bitbucket
# personal settings > SSH keys > Add key
# paste in key and give name