Skip to content

Instantly share code, notes, and snippets.

@KyleAure
Last active January 17, 2019 18:14
Show Gist options
  • Save KyleAure/96983645aaaa327a9e3faa0a104a05bb to your computer and use it in GitHub Desktop.
Save KyleAure/96983645aaaa327a9e3faa0a104a05bb to your computer and use it in GitHub Desktop.

Naviate to directory

Open terminal and navigate to the directory you want to use.

cd desktop

Check git version

Check that you have git installed.

git --version

If you do not have git installed you should be prompted to install it.

Cloning

Attempt to clone git repo

git clone git@git.ng.bluemix.net:jeberhard/XXX-cs410-winona.git

You should be prompted to enter your SSH passphrase and to add bluemix to your trusted hosts.

If you get an error such as:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

Redo your SSH passphrase

The verson of eclipse that RSA is built on top of changed your .ssh directory permissions and generated a key that is not secure enough for gitlab. First generate a new key.

ssh-keygen -t rsa

When prompted for save location hit enter for default .ssh directory Overwrite existing SSH key's stored in this location. Create a passphrase for your SSH key.

Then open file explorer and navigate to your root directory ~/.ssh This is a hidden file so you may need to set you system to show hidden directories by typing CMD + SHIFT + .

Inside this folder find the id_rsa.pub this is your public key. Open this file in text edit and copy your public key. Open your gitlab repo and replace your old SSH key with this one.

Now go back to terminal and change the permissions on these files to once again be passphase procted.

sudo chmod 600 ~/.ssh/id_rsa
sudo chmod 600 ~/.ssh/id_rsa.pub

Try git clone again

Attempt to clone git repo again

git clone git@git.ng.bluemix.net:jeberhard/XXX-cs410-winona.git

Optional creature comfort

Every time you pull or push from your local stystem to remote repo you will need to type your SSH passphrase. Instead of typing it everytime you can set up an SSH agent so you only need to type it once per terminal session.

ssh-add ~/.ssh/id_rsa

If you are truly lazy you can add this command to your bash profile. Open the ~/.bashprofile file Create a new line with: ssh-add ~/.ssh/id_rsa #Add SSH Identity on startup

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