Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Setting up github on Ubuntu
#!/bin/bash
###############################################
# To use:
# wget https://raw.github.com/gist/4411254
# chmod 777 github-ubuntu.sh
# ./github-ubuntu.sh
###############################################
echo "*****************************************"
echo " Step 1: Check your keys"
echo "*****************************************"
cd ~/.ssh
echo "if it says 'bash: cd: ./.ssh:No such file or directory', it "
echo "means its not generated and you should skip step 2."
echo "*****************************************"
echo " Step 2: Backup and remove existing SSH keys "
echo "*****************************************"
mkdir key_backup
cp id_rsa* key_backup
rm id_rsa*
echo "*****************************************"
echo " Step 3: Generate your credentials"
echo "*****************************************"
ssh-keygen -t rsa -C "dan@youremail.com"
echo " Now hit enter three times - acccept defaults"
echo "*****************************************"
echo "You will get following lines:"
echo "Generating public/private rsa ket pair. "
echo "Enter file in which to save the key(/Home/ubuntu/.ssh/id_rsa):"
echo "just press enter and now it will ask you to enter passphrase."
echo "note that passphrase you enter must be >4, otherwise you will "
echo "have to repeat whole process again."
echo "*****************************************"
echo " You should see:"
echo ""
echo "Your identification has been saved in /home/dan/.ssh/id_rsa."
echo "Your public key has been saved in /home/dan/.ssh/id_rsa.pub."
echo "The key fingerprint is:..."
echo "================================="
echo " Step 4: Save your new key"
echo "================================="
ssh-add ~/.ssh/id_rsa
echo "*****************************************"
echo " Step 5: Add your key to github"
echo "*****************************************"
echo "This command copies it so you can paste it"
echo "*****************************************"
gedit id_rsa.pub
echo "*****************************************"
echo " Copy its entire content. Then open the github "
echo " web site and login. go to 'Account Settings' >"
echo " Click 'SSH Public Keys' > Click "
echo " 'Add another public key' an paste it into "
echo " 'key field' then press Add key."
echo "*****************************************"
echo "*****************************************"
echo " Step 6: Check your keys"
echo "*****************************************"
echo " You should see this:"
echo " Hi dstroot! You've successfully authenticated, but GitHub does not provide shell access."
echo " Connection to github.com closed."
echo "*****************************************"
ssh git@github.com
echo "*****************************************"
echo " Step 7: Install the git tools"
echo "*****************************************"
sudo apt-get install git-core git-gui git-doc
echo "*****************************************"
echo " Step 8: Now configure git"
echo "*****************************************"
git config --global user.name "first last"
git config --global user.email "dan@.com"
git config --global github.user username
echo "================================="
echo " Good to go! "
echo "================================="
@ricoms
Copy link

ricoms commented Jul 26, 2019

What is supposed to be "username" at line 72?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment