After running successfully, my build script attempts to copy the final binary onto my FTP server using the scp command. Since the build takes a while, I don't want to be prompted for my password every time, so I tried to set up an SSH-keypair.
[wbarlow@build-machine]$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/wbarlow/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/wbarlow/.ssh/id_rsa.
Your public key has been saved in /home/wbarlow/.ssh/id_rsa.pub.
The key fingerprint is:
7f:b9:c7:a8:1b:77:ce:f8:b6:2a:e3:da:30:68:72:b7 wbarlow@build-machine
[wbarlow@build-machine]$ ssh-copy-id wbarlow@ftp-server
wbarlow@ftp-server's password:
Now try logging into the machine, with "ssh 'wbarlow@ftp-server'", and check in:
~/.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
Then I tried to sign into my ftp-server, but I was still prompted for a password. I confirmed that the freshly created key was present.
[wbarlow@build-machine]$ ssh wbarlow@ftp-server
wbarlow@ftp-server's password:
[wbarlow@ftp-server]$ cat ~/.ssh/authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDGUbr4vUeiY7D6sSrsHm469QAqCClchL
7h/HZ7TAc+1F2KsTTF078OSINqzz8NpKJqhlEusLn644PzYn9LmGTIc7IsMG9s+B2n4bZX
9Ypb0VqLSqTgfE2I0j84+SfAQ6MvGJQ0NupIXxXbaMLDlNq1cetnR8NeN+9JeBq4sI8p/a
ijFVARQ7/XSKwQQN30Nl6flTEM1CTDECJs5YsPOu3P54mF6PG2mBdFra6+VQfAZ6fboq9O
d24VNHLYVtUdK5RpWgx8agUalov0xq/3m2VeC5arrYpCVH1rGx6EMxoQS25kk7t9mzBUCj
ulXGWQX2DPR/Em0OIfvVfe/l4xtFfH wbarlow@build-machine
So -- how can I check that the FTP server is configured to accept authorized keys, and what sort of keys is it configured to accept? How can I check that the keys are being stored in the expected place (my home directory on ftp-server is /var/ftp/wbarlow/, but I've also tried copying the .ssh folder from there to /home/wbarlow/.)?
My .ssh directory is mode 700, and my authorized_keys file is mode 600. I've also tried using 755 for the .ssh directory.
Below is the output of the ssh -v command.
OpenSSH_5.1p1, OpenSSL 0.9.8g 19 Oct 2007
usage: ssh [-1246AaCfgKkMNnqsTtVvXxY] [-b bind_address] [-c cipher_spec]
[-D [bind_address:]port] [-e escape_char] [-F configfile]
[-i identity_file] [-L [bind_address:]port:host:hostport]
[-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
[-R [bind_address:]port:host:hostport] [-S ctl_path]
[-w local_tun[:remote_tun]] [user@]hostname [command]