Full instruction is here.
- Run command.
ssh-keygen -t ed25519 -C "your_email@organization_domain"
- Specify filename in
%USERPROFILE%/.ssh/github
. - Add generated public SSH key into Github account. Instruction.
Full instruction is here
- Run command
ssh-keygen -t ed25519 -C "your_email@organization_domain"
- Specify filename
%USERPROFILE%/.ssh/bitbucket
- Add generated public SSH key into Bitbucket account. Instruction
Full instruction is here
- Run command
ssh-keygen -t ed25519 -C "your_email@organization_domain"
- Specify filename
%USERPROFILE%/.ssh/gitlab
- Add generated public SSH key into Gitlab account. Instruction
- Kill SSH-agent if exists and run in the background
killall ssh-agent; eval "$(ssh-agent)"
- Add private SSH keys to the ssh-agent
ssh-add ~/.ssh/github
ssh-add ~/.ssh/bitbucket
ssh-add ~/.ssh/gitlab
- Optional. Copy SSH keys into the Windows directory or any other WSL
cp -b ~/.ssh/github /mnt/c/Users/%USERPROFILE%/.ssh/
cp -b ~/.ssh/bitbucket /mnt/c/Users/%USERPROFILE%/.ssh/
- Test your connection
ssh -T [email protected]
ssh -T [email protected]
ssh -T [email protected]
The next steps should be done in each environment where you need access to Git (Windows, WSLs, etc.)
- Create config using
nano
nano ~/.ssh/config
- Put the next config into
%USERPROFILE%/.ssh/config
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/github
Host github.com-username
HostName github.com
User git
IdentityFile ~/.ssh/username
Host bitbucket.org
HostName bitbucket.org
User git
IdentityFile ~/.ssh/bitbucket
Host gitlab.com
HostName gitlab.com
User git
PreferredAuthentications publickey
IdentityFile ~/.ssh/gitlab
- Optional. Copy SSH config into each environment
cp -b ~/.ssh/config /mnt/c/Users/%USERPROFILE%/.ssh/
- Set up autostarting
ssh-agent
- Update
%USERPROFILE%/.profile
on the next way using:nano .profile
- In the end of the file, put the next
if [ "$BASH" ]; then if [ -f ~/.bashrc ]; then . ~/.bashrc eval "$(ssh-agent -s)" fi fi mesg n 2> /dev/null || true
- Update
By default,
git clone [email protected]:organization/remote-repository.git
git clone [email protected]:organization/remote-repository.git
git clone [email protected]:organization/remote-repository.git
For specific account,
git clone [email protected]:organization/remote-repository.git