0

I purchased the great Agile Web Development with Rails book and I am reading the Chapter 16: Deployment and Production. In that chapter there is a part (page 233) where it says how to set SSH keys:

test -e ~/.ssh/id_ssh.pub || ssh-keygen -t dsa
cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorizedkeys2

but there is a very "minimal" text\description on how to "ssh'ing", so I did not understand some things. Where I should run the above commands: on the local or on the remote machine? And then, what I should to do to make it work?

P.S.: If I understood those keys serves me to not enter anymore password using the Capistrano gem. Is it them purposes?

Backo
  • 18,291
  • 27
  • 103
  • 170

2 Answers2

1

You generate a key pair on your own computer, and you copy the public key to the server. Then every time you log in to the server, instead of typing a password, you pass authentication using your private key.
You can read here about how to setup ssh authentication with keys:
How do I setup Public-Key Authentication?

Community
  • 1
  • 1
NARKOZ
  • 27,203
  • 7
  • 68
  • 90
0

Here is the paragraph that preceded those instructions:

The next thing to be aware of is that even if the SCM server and our web server are the same physical machine, Capistrano will be accessing our SCM software as if it were remote. We can make this smoother by generating a public key (if you don't already have one) and then using it to give ourselves permission to access our own server:

The intent here is that you execute those commands on the server so two different processes on the same machine (i.e. the SCM server and the web server) can communicate.

Disclosure: I am the author of that text, and appreciate the compliment. :-)

Sam Ruby
  • 4,270
  • 22
  • 21
  • When you say "on the server" you refer to the local or to the remote machine? P.S.: Your book is one of the best I have read (It seem like I wrote that!!! B-P). – Backo Aug 01 '11 at 13:23
  • remote; i.e. the one that is running passenger and git. – Sam Ruby Aug 01 '11 at 17:31