setup • SSH key via CLI in Terminal - martindubenet/wed-dev-design GitHub Wiki
The best secure protocol to access git sources from cloud services sutch as GitHub, GitLab or Atlassian BitBucket is using an SSH key.
An SSH key is an access credential in the SSH protocol. Its function is similar to that of user names and (a very complex) passwords, but the keys are primarily used for automated processes and for implementing single sign-on by system administrators and power users.
Source: https://www.ssh.com/ssh/key.
C:\Users\YOUR_USERNAME\.ssh
First make sur that you have the access rights to view System files.
The password is optional. If you don't want to provide one simple click « Enter » when the command ask to provide one.
- If you don't have an « .ssh » folder on your workstation, here's the Bash Terminal command lines to create it:
cd ~/ mkdir .rss && cd .rss
- Generate the key
ssh-keygen -o
-OR-
ssh-keygen -t rsa -b 2048 -C "<comment>"
Then generate the two SSH required files « id_rsa
» and « id_rsa.pub
» using one of the two command lines :
ssh-keygen -t ed25519 -C "[email protected]"
- Open the «
*.pub
» file with your prefered text editor and copy the content of the file.- macOS :
~/.rss/id_rsa.pub
- Windows :
~/.rss/ls.pub
- macOS :
- Go to your account settings, go to
Profile
>Settings
>SSH Keys
:-
BitBucket : https://bitbucket.org/account/ >
Security / SSH keys
- GitHub : https://github.com/settings/keys
-
GitLab : https://gitlab.com/profile/keys/ >
Profile / Edit profile / SSH Keys
-
BitBucket : https://bitbucket.org/account/ >
- Click on « Add a new key », give it a name according to your workstation like « office pc », then paste the content of your key then save it.