12492

Adding SSH Keys to remote servers

Question:

I would like to know what people would suggest as a good way to add a deployment key to a remote server, so that it may checkout a private git repo.

I've been trying to deploy an application with Capistrano but keep getting failures with the SSH keys I believe when attempting to checkout the repository the application is linked to.

I have tried Agent Forwarding but I think I might be better just adding a deployment key to each remote server and then adding this key to the repository.

How best would I go about doing this? I'm looking for a few simple commands to run off against each remote server.

Answer1:

I think yo want to copy the users' public keys to the server and then add'em to the ssh, right?

To do that you need to do the following:

Copy keys to server

copy from my machine to a remote machine:

scp key_name.pub git@serverIP:key_name.pub

Then cat it to the authorized_keys file

cat key_name.pub >> .ssh/authorized_keys

Recommend

  • What's the URL for rails app deployed by Capistrano
  • Workflow for maintaining different versions of a webapp using git?
  • Rails, Slicehost, Capistrano - Deployment port issues
  • Golang: “compress/flate” module can't decompress valid deflate compressed HTTP body
  • How can I get test kitchen run same chef recipe multiple times?
  • BPEL Designer for Eclipse: how to debug a BPEL process
  • Netezza aggregation issue (pivot)
  • @RunWith causes Maven to ignore my Test running with my own runner
  • JENKINS: ERROR when I try to use an older JDK for a specific maven project
  • Referencing external dependencies in GGTS by convention
  • force insert with spring data jpa
  • how tensorflow worker driver training process and cause variables update on ps job?
  • Google cloud datastore emulator init data
  • “git push” doing the same as “git fetch” from the remote
  • WP7 - read from CSV file? Or what to do with the data?
  • `docker cp` doesn't copy file into container
  • How to check disabled jobs with Jenkins server?
  • Python Paramiko send CTRL+C to an ssh shell
  • How to resolve dependencies from one gradle project to another gradle project in my Eclipse workspac
  • EF 4.1 DBContext AutoDetectChangesEnabled
  • Varnish/Apache Random 503 Errors
  • Cross platform UI spacing/padding
  • ImportError: cannot import name Pubnub
  • Check for zero lines output from command over SSH
  • Array with custom indexes in Ionic2
  • How to add git credentials to the build so it would be able to be used within a shell code?
  • Installing iPhone App to iPhone
  • VSO Build — Response status code does not indicate success: 404 (Not Found)
  • Database structure design with variable amounts of fields
  • Highlight one bar in a series in highcharts?
  • Launch Runnable Jar from Web Start
  • C# - Serializing and deserializing static member
  • How do I fake an specific browser client when using Java's Net library?
  • Check if a string to interpolate provides expected placeholders
  • Sending data from AppleScript to FileMaker records
  • Javascript + PHP Encryption with pidCrypt
  • XCode can't find symbols for a specific iOS library/framework project
  • VB.net deserialize, JSON Conversion from type 'Dictionary(Of String,Object)' to type '
  • How to include full .NET prerequisite for Wix Burn installer
  • Is it possible to post an object from jquery to bottle.py?