scp works with identical box A, fails with box B
Hi everyone, Linux newbie using red hat.
I am user1@machine1, and have written a tiny sh script to scp a file without being prompted for a password.
I run the script on machine1, it uploads a file to the homedir of userA@machineA. I cat'ed user1's public key into copied it to machineA/usr/userA/.ssh/authorized_keys. It works like a dream. The file gets uploaded automatically without a password.
However when I try the exact same thing on machineB it fails, meaning that it requests a password, so I can't automate the uploading process.
I have spent about 8 hours double-checking that everything is the same on machines A and B; the permissions, the file locations, the directory names, everything. Machine1 can scp to A, but not to B.
I tried running the script with the -vvv parameter, and studied the results very closely, side by side on a spreadsheet.
Everything seems practically the same (except for ip addresses and such) until line 140, which on server A says :
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug3: Wrote 368 bytes for a total of 1477
debug1: Server accepts key: pkalg ssh-rsa blen 277
but in server B says:
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug3: Wrote 368 bytes for a total of 1477
debug1: Authentications that can continue: publickey,gssapi-with-mic,keyboard-interactive
So B says "authentications that can continue" instead of A's "server accepts key". B then continues :
debug1: Trying private key: /home/transfer/.ssh/id_dsa
debug3: no such identity: /home/transfer/.ssh/id_dsa
debug2: we did not send a packet, disable method
at which point serverB decides to ask for a keyboard-interactive password.
I compared the ssh_config and sshd_config files on all three machines. They were virtually identical, except for minor things like leading spaces on some lines.
There's only one difference, in both target machines (A and B) the ssh -ver command gives OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
However, in the source machine (machine1) the same command gives OpenSSH_5.3p1, OpenSSL 1.0.0-fips 29 Mar 2010. I'm not sure this means much, because it's the same source machine, albeit with a different version, trying to scp into two identically-configured machines. If it works on one, why not the other?
Am going nuts, would be deeply grateful for any tips.
|