Skip to content

Instantly share code, notes, and snippets.

@badhonhitech
Created October 4, 2020 18:33
Show Gist options
  • Save badhonhitech/004b36edff5a6d8f57b9fc0b17161acc to your computer and use it in GitHub Desktop.
Save badhonhitech/004b36edff5a6d8f57b9fc0b17161acc to your computer and use it in GitHub Desktop.
#!/bin/bash
# To Install latest Git using PPA run this command:
sudo add-apt-repository ppa:git-core/ppa
sudo apt update
sudo apt install git
# To check Git version run this command:
git --version
# To Configure Git run this command:
sudo git config --global user.name "yourname"
sudo git config --global user.email "youremail@example.com"
# To check Git configuration settings run this command:
git config --list
# Checking for existing SSH keys
ls -al ~/.ssh
# If you do not see any file name "id_rsa.pub" into a list that means your Ubuntu do not have existing SSH key.
# if you see any file name "id_rsa.pub" into a list that means you Ubuntu have existing SSH keys.
# Generating a new SSH key and adding it to the ssh-agent
ssh-keygen -t rsa -b 4096 -C "youremail@example.com"
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
cat /home/khaleda/.ssh/id_rsa.pub
# copy the key and add your new SSH key to your GitHub account visit: https://help.github.com/en/articles/adding-a-new-ssh-key-to-your-github-account
# Checking for existing SSH keys
ls -al ~/.ssh
# Now you see a file name "id_rsa.pub" into a list that means you Ubuntu now have existing SSH key.
# Testing your SSH connection
ssh -T git@github.com
Warning: Permanently added the RSA host key for IP address '192.30.255.113' to the list of known hosts.
Enter passphrase for key '/home/amin/.ssh/id_rsa':
Hi badhonhitech! You've successfully authenticated, but GitHub does not provide shell access.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment