xxxxxxxxxx
1. ssh-keygen -o -t rsa -C "your_email@example.com"
2. Press return for each option
3. cat ~/.ssh/id_rsa.pub
4. Copy the entire cat's output on "Settings - SSH and GPG keys - New SSH key" on GitHub
xxxxxxxxxx
# Generating an ssh-keygen
# Change directory to the ssh directory
cd ~/.ssh
# Create SSH Key
ssh-keygen -o -t rsa -C "email@email.com"
# Add SSH Key (not the .pub file) to SSH Agent
eval `ssh-agent -s`
ssh-agent -s
ssh-add ~/.ssh/filename
# Create SSH Config file (~/.ssh/config)
"""
# Personal GitHub
Host github.com
HostName github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/personal_rsa
# Non-Personal GitHub
Host nonpersonal.github.com
HostName github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/nonpersonal_rsa
"""
# ssh-add
ssh-add -l
# test
ssh -T git@github.com
ssh -T git@nonpersonal.github.com
# Copy the contents of the ssh key public file (.pub file) to clipboard
# (WSL2 Specific)
cat filename.pub | clip.exe
# Go to "https://github.com/settings/keys"
# Click New SSH Key
# Paste the contents of the public file to Key
# Click Add SSH Key
# Go to the repository of the project you want to clone
# Select the SSH Link and copy it to the clipboard
# Then clone the repo
git clone git@github.com:SOME_ORGANIZATION/SOME_PROJECT.git
xxxxxxxxxx
# CREATE SSH
1. ssh-keygen
2. cd ~/.ssh
3. cat id_rsa.pub
4. copy key
# CONNECT TO GITHUB
1. settings
2. SSH and GPG keys
3. SSH keys -> new SSH key
xxxxxxxxxx
# Generate a new SSH key
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
# Start the ssh-agent in the background
eval "$(ssh-agent -s)"
# Add your SSH key to the ssh-agent
ssh-add ~/.ssh/id_rsa
# Copy the SSH key to the clipboard
sudo apt-get install xclip
xclip -sel clip < ~/.ssh/id_rsa.pub
xxxxxxxxxx
# Generate a new SSH key (if you don't have one already)
$ ssh-keygen -t ed25519 -C "your-email@example.com" -f ~/.ssh/id_github
# Start the ssh-agent in the background
$ eval "$(ssh-agent -s)"
# Add the private key to the ssh-agent
$ ssh-add ~/.ssh/id_github
# Copy the public key to your clipboard
$ cat ~/.ssh/id_github.pub | pbcopy
# Now, go to the GitHub website and follow these steps:
# 1. Go to your profile settings
# 2. Select "SSH and GPG keys" from the sidebar
# 3. Click on "New SSH key"
# 4. Provide a title for the key (e.g., "Personal Laptop")
# 5. Paste the copied key into the "Key" field
# 6. Click on "Add SSH key"
xxxxxxxxxx
$ clip < ~/.ssh/id_ed25519.pub
# Copies the contents of the id_ed25519.pub file to your clipboard