Luke Burns
Luke Burns

Reputation: 1929

How can I setup a git repo on my box?

I'm trying to setup a remote git repo on my box. It's unexpectedly asking me for an ssh password, because I have public keys setup and can connect via ssh regularly.

How can I setup a git repo?

Upvotes: 0

Views: 2472

Answers (2)

codeprimate
codeprimate

Reputation: 1376

In addition to AJ's answer: if you are connecting to the Box via a local ssh client, you can also configure your ssh client to forward your local keys seamlessly. For example, I added the following to my ~/.ssh/config:

Host myhostname
Hostname usw1.actionbox.io
Port 9999
User action
IdentityFile ~/.ssh/id_rsa
ForwardAgent yes

In this case, if you "ssh myhostname", you will login to the Box and be able to authenticate against hosts (including Github) just as if you were doing so from your local machine. Please keep in mind, this will do you no good if you are using the terminal within the web IDE.

Tangentially, if you are a Rails developer using Capistrano, the following configuration line does the same, eliminating the need for deploy keys:

ssh_options[:forward_agent] = true

Upvotes: 2

ajhit406
ajhit406

Reputation: 1405

You'll need to actually add your new box's public key to Github. Luckily, Nitrous.IO makes it easy to do this:

  1. In your list of Boxes (you might only have one). Click the box to toggle its details
  2. Click the "Reveal Public Key" link
  3. Click the "Add to Github" link

This will generate an ssh keypair for your box and will add it to Github. Note that this is different than your SSH keys that you'll add to SSH into your Nitrous.IO box.

Then you'll want to use the "ssh" method to clone, so the link will start with [email protected]...

There's a full rundown here:

http://help.nitrous.io/github-add-key/

Upvotes: 2

Related Questions