xxxxxxxxxx
# 1/ check for previous keys (should not exists before the first time)
cd ~/.ssh #check for already existing pair of id_x and id_x.pub (id_rsa/id_edxxx/ )
# 2/ generate keys (if you dont have any) - pick one
#rsa
ssh-keygen -o
#ed algorithm (recommended)
ssh-keygen -t ed25519 -C you@mail.com
# 3/ add the key to the shh-agent
eval "$(ssh-agent -s)" #if the agent is running, it should return something like Agent pid 18544
sh-add ~/.ssh/id_ed25519 #or: ssh-add ~/.ssh/id_rsa
# 4/ copy the public key
cat ~/.ssh/id_ed25519.pub #or: cat ~/.ssh/id_rsa.pub
# copy all: ssh-ed25510...... you@mail.com or ssh-rsa....... you@mail.com
# 5/ past it to the github
# login - profile prefferences - ssh and gpg keys - new SSH key and paste 4/
# 6/ verify
ssh -v git@github.com
# if you got the following error:
# The authenticity of host 'github.com (ip)' can't be established.
# execute the following command and try again:
ssh-keyscan github.com >> ~/.ssh/known_hosts
xxxxxxxxxx
github.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCj7ndNxQowgcQnjshcLrqPEiiphnt+VTTvDP6mHBL9j1aNUkY4Ue1gvwnGLVlOhGeYrnZaMgRK6+PKCUXaDbC7qtbW8gIkhL7aGCsOr/C56SJMy/BCZfxd1nWzAOxSDPgVsmerOBYfNqltV9/hWCqBywINIR+5dIg6JTJ72pcEpEjcYgXkE2YEFXV1JHnsKgbLWNlhScqb2UmyRkQyytRLtL+38TGxkxCflmO+5Z8CSSNY7GidjMIZ7Q4zMjA2n1nGrlTDkzwDCsw+wqFPGQA179cnfGWOWRVruj16z6XyvxvjJwbz0wQZ75XK5tKSb7FNyeIEs4TT4jk+S4dhPeAUC5y+bDYirYgM4GC7uEnztnZyaVWQ7B381AK4Qdrwt51ZqExKbQpTUNn+EjqoTwvqNj4kqx5QUCI0ThS/YkOxJCXmPUWZbhjpCg56i+2aB6CmK2JGhn57K5mj0MNdBXA4/WnwH6XoPWJzK5Nyu2zB3nAZp+S5hpQs+p1vN1/wsjk=
xxxxxxxxxx
SSH stands for Secure Shell.
When working with a GitHub repository,
you'll often need to introduce yourself to
GitHub using your username and password.
SSH key is an alternate way to identify yourself
that doesn't require you to enter you username and password every time.
SSH keys come in pairs, a public key that
gets shared with services like GitHub,
and a private key that is stored only on
your computer. If the keys match, you're granted access.