Step 1 Setup Git
Add GitHub or Bitbucket SSH (Mac + Windows)
GitHub (SSH Setup)
đ Find & Replace (according to your need)
- Email:
youremail@example.com - Key name:
id_rdgh - Host alias:
rdgh.github.comHere,
rdghis the shorthand which you will need if you want to set up multiple accounts.
đ Generate and Add SSH Key
If GitHub Desktop is installed, you can clone repositories without SSH keys.
đĒ Windows (PowerShell â Admin)
Get-Service -Name ssh-agent | Set-Service -StartupType Manual
Start-Service ssh-agent
Add key (non-admin terminal):
ssh-add "C:\Users\Rana Depto\.ssh\id_rdgh"
đ macOS / Linux
cd ~/.ssh
ssh-keygen -t ed25519 -C youremail@example.com
Legacy systems:
ssh-keygen -t rsa -b 4096 -C youremail@example.com
File name when prompted:
id_rdgh
Passphrase: Leave empty (press Enter twice).
âļī¸ Start ssh-agent (if needed)
eval "$(ssh-agent -s)"
âī¸ SSH Config File
Edit config:
code ~/.ssh/config
Windows path
C:\Users\Rana Depto\.ssh\config
Add:
Host rdgh.github.com
HostName github.com
AddKeysToAgent yes
IdentityFile C:\Users\Rana Depto\.ssh\id_rdgh
If error appears:
Host github.com
IgnoreUnknown UseKeychain
â Add Key to Agent
macOS
ssh-add --apple-use-keychain ~/.ssh/id_rdgh.pub
Windows
ssh-add "C:\Users\Rana Depto\.ssh\id_rdgh"
đ Add SSH Key to GitHub
Login: https://github.com/login
SSH Keys Page: https://github.com/settings/keys
Copy key:
code id_rdgh.pub
Add Title and Key
â Test Connection
ssh -T git@rdgh.github.com
Expected:
Hi USERNAME! You've successfully authenticated, but GitHub does not provide shell access.
đ Reset SSH Cache (If Needed)
ssh-add -D
ssh-add ~/.ssh/id_rdgh
ssh-add -ld
đĻ Clone Examples
git clone git@github.com:researchacademy/test.git
git clone git@github.com:ranadepto/CyberSecurity.git
Bitbucket (SSH Setup)
đ Find & Replace
- Email:
youremail@example.com - Key name:
id_rdbb - Host alias:
rdbb.bitbucket.org
đ Generate SSH Key
Reference: https://support.atlassian.com/bitbucket-cloud/docs/set-up-personal-ssh-keys-on-macos/
cd ~/.ssh
ssh-keygen -t ed25519 -C youremail@example.com
File name
id_rdbb
â Add Key to Agent
macOS
ssh-add --apple-use-keychain ~/.ssh/id_rdbb.pub
Windows
ssh-add "C:\Users\Rana Depto\.ssh\id_rdbb"
âī¸ SSH Config
code ~/.ssh/config
Add:
Host rdbb.bitbucket.org
HostName bitbucket.org
AddKeysToAgent yes
IdentityFile ~/.ssh/id_rdbb
đ Add SSH Key to Bitbucket
https://bitbucket.org/account/settings/ssh-keys/
Copy key:
macOS
pbcopy < ~/.ssh/id_rdbb.pub
Windows
code id_rdbb.pub
Add key with a meaningful label.
â Test Connection
ssh -T git@rdbb.bitbucket.org
Expected:
authenticated via ssh key.
You can use git to connect to Bitbucket. Shell access is disabled
đĻ Clone Example
git clone git@rdbb.bitbucket.org:ranadepto/WebFrontend.git
âšī¸ Notes
- Public keys must end with
.pub - If SSH key is invalid, ensure the entire key is copied
- Multiple accounts supported using SSH host aliases