Hi,
I want to login to a remote server and sftp files without password prompting. So, I created private-public key pair as follows:
[user1@server1.com .ssh]$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/user1/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in .ssh/id_rsa.
Your public key has been saved in .ssh/id_rsa.pub.
The key fingerprint is:
c1:21:e 3:01:26:0d:f7:ec:52:0e:0c:90:9b:6e:d8:47 user1@server1.com
NOTE: I haven't provided passphrase
Now on the "remote" server say, server2.com. I appended the content of id_rsa.pub file to <server2.com's home>/.ssh/authorized_keys file which is ssh-rsa <lot of chars> user1@server1.com
Then with everything set-up I tried:
sftp user2@server2.com
user2@server2.com's password:
but boom! It still asks for password!!
someone told me I can find problem through ssh-v command so I tried it and this what it has to say:
[user1@server1.com ~]$ ssh -v user2@server2.com
OpenSSH_3.9p1, OpenSSL 0.9.7a Feb 19 2003
debug1: Reading configuration data <user1 home>/.ssh/config
debug1: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to server2.com [IP ADDRESS] port 22.
debug1: Connection established.
debug1: identity file <user1 home>/.ssh/identity type -1
debug1: identity file <user1 home>/.ssh/id_rsa type 1
debug1: identity file <user1 home>/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_4.3
debug1: match: OpenSSH_4.3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.9p1
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'server2.com' is known and matches the RSA host key.
debug1: Found key in <user1 home>/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Next authentication method: gssapi-with-mic
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Next authentication method: publickey
debug1: Trying private key: <user1 home>/.ssh/identity
debug1: Offering public key: <user1 home>/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Trying private key: <user1 home>/.ssh/id_dsa
debug1: Next authentication method: password
user2@server2.com's password:
but I am not able to debug it!! Can anyone here please help me?
-dips