-
-
Save MarHoff/3f8a3f23805aff3b583d20c367e6d623 to your computer and use it in GitHub Desktop.
Setting up github on Ubuntu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 "[email protected]" | |
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 [email protected] | |
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 "[email protected]" | |
git config --global github.user username | |
echo "=================================" | |
echo " Good to go! " | |
echo "=================================" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment