Last updated 11 March 2017.

This is a simple method to create, upload and verify an SSH Key with

Generate a key for the first time

Open the Git Bash window and change to the .ssh directory

cd ~/.ssh

If the .ssh directory does not exist, change to the user directory then create the .ssh directory and enter it.

cd ~
mkdir .ssh
cd .ssh

NOTE: Do not include any spaces in your keyname as it can cause problem when you upload your public key to some sites.

At the Git Bash prompt, enter:

ssh-keygen -t rsa (optional " -C keyname" where keyname is anything you want)

You should see:

Generating public/private rsa key pair.
Enter file in which to save the key (/u/.ssh/id_rsa):

Press 'Enter' here to accept the default

Enter passphrase (empty for no passphrase):
Enter same passphrase again:

Press enter to leave the passphrase empty.

Your identification has been saved in /u/.ssh/id_rsa.
Your public key has been saved in /u/.ssh/
The key fingerprint is:
7e:f5:7e:51:ec:3d:2c:36:02:9d:5b:89:4a:3a:b7:b5 keyname

Copy your Key

If you are following the exact instruction given above(i.e your current dir is .ssh), just type in Git Bash:


You should see something like:

OBaagayPGPItqx8cuebGiCdR7an5o6XYefcWgeNxa8gYNjOUWs3TSw7if6o4GnG/4Jwk/f8abaG9BYv/OpLlpeV rgkKWhVL56yWgd8Pbry3y6yM/S3T3lfYYdfbzo8JecHFnFrhCdYXbftg2qcvfRq/iXaoHQlJzUkr5zpu1pyD7Pd M/1H6YlBlP18Ge+lAfgLZd9x8nxMNAq+0zrozitIRC/kR5LE7HbJWBrFhFZQqFpVSSXwIZDpou6Js7c5GP2S/0 O+z2FvrbjvP9g4/mrRv48a3R/0tc4U0GWlAFMp6W/CZjaYQe74/3Y2rGvYLyh762AqVagWOnnmw== keyname

Even though you can see it, right there, you can't copy and paste it unless you've changed some Windows system settings. Instead, open the file with a text editor like Notepad. It's located at /u/.ssh/ in our example. The path on your machine is visible in Git Bash after the "Enter file in which to save the key".

Put your key on

  1. Log in to
  2. Click "Your Dashboard" » Profile » SSH Keys » Add a public key
  3. Paste your key into the text area. Anything after the == will become the title of your key, so if you've been following along, you can leave the title blank. It's purely for your convenience, so you can also name it anything you want, perhaps the name of the computer the key associates with (my laptop).

Test your key

To test your key, clone an actual project from You can use the example below or locate the clone command for a project you actually need.

NOTE: The below code attempts to log you into However, you can not login until you have created your git username and agreed to the Drupal version control system rules. To do this, login into your account on, select Your Dashboard tab, select the Profile tab, select Edit, select Git Access. On the Git Access page, you will need to agree to the Drupal version control rules and follow the rest of the instructions on this page. Once you have completed all of the steps, you can proceed with the below code.

Also you will need to change the text "username" to the user name you created on the Git Access page.

git clone

You should see:

Initialized empty Git repository in /home/melissa/examples/.git/
The authenticity of host ' (' can't be established.
RSA key fingerprint is 16:f5:44:6c:a1:c6:be:72:cd:98:b5:b7:7d:26:d6:14.
Are you sure you want to continue connecting (yes/no)? 

Type 'yes' at the prompt and press 'Enter'.
Next you'll see something like:

Warning: Permanently added ',' (RSA) to the list of known hosts.
remote: Counting objects: 1737, done.
remote: Compressing objects: 100% (619/619), done.
remote: Total 1737 (delta 1176), reused 1667 (delta 1106)
Receiving objects: 100% (1737/1737), 525.92 KiB | 846 KiB/s, done.
Resolving deltas: 100% (1176/1176), done.

If you are not asked for a password, you have successfully set up a new SSH key.
If you're just testing, then finish by removing the clone directory you just downloaded:

cd ~
rm -rf examples

That's it! You are done.


OddJob’s picture

You should not have spaces in the key name, while you can use any name, firstname@lastname is a good choice provided it has no spaces!! Use your firstname and lastname.

If you have spaces in your name it will cause you errors.

Also in order to test using your name - you have to make sure you agree to the get access section of your drupal profile.

Or you can use "". If you agree under your profile, then you can use your "

Here is a link to more on using "" instead of "[git-user]": Git documentation remember git-user is referring to your user name!

On that page you will find this section: Why do I need a username if I'm using SSH keys?
You don't! You can use also use the familiar[projectname].git.

Note: the instructions should have been edited to reflect some of this commentary.

mavaddat’s picture

I was able to insert a key-name with spaces (like "FIRSTNAME LASTNAME@COMPUTER") and the connection, authentication, and example cloning worked fine for me.

kaizerking’s picture

when entered cat .ssh/ it says "no such file or directory"(wind xp)

clivesj’s picture

In the example we are already in the directory .shh so we enter:

rakesh.gectcr’s picture

Please check this,

It may help you..

Rakesh James

myglobaldata_gil’s picture

A question to clarify the instruction for "Test your key." Several individuals tried using the line:
and in return, we were asked to enter our drupal password and the test did not run. However, when we used:
the Test ran successfully. Could it be that the "username" option is no longer valid and should be removed?