SFTP connection problem


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting SFTP connection problem
# 1  
Old 12-14-2009
MySQL SFTP connection problem

Dear All,

I'm trying to configure the passwordless connection between two servers say Server A and Server B.

My requirement is a passwordless connection from Server A to Server B.
I have done the configuration in both the servers. In Server A its successfull but from Server B its everytime asking from password. While i debug the connection i found that its taking two id_rsa file. The path mentioned in the output, i dint found the two id_rsa files in it. Could anyone please help regarding this. For your reference i'm providing the optput. Another thing is though i haven't created the id_dsa file still its asking for id_dsa file.

Code:
ssh -vvv  proj70@147.149.253.220
OpenSSH_4.1, OpenSSL 0.9.7e 25 Oct 2004
HP-UX Secure Shell-A.04.00.001, HP-UX Secure Shell version
debug1: Reading configuration data /opt/ssh/etc/ssh_config
debug3: RNG is ready, skipping seeding
debug2: ssh_connect: needpriv 0
debug1: Connecting to 147.149.253.220 [147.149.253.220] port 22.
debug1: Connection established.
debug3: Not a RSA1 key file /home/prod_01/.ssh/id_rsa.
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug3: key_read: missing keytype
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug2: key_type_from_name: unknown key type '-----END'
debug3: key_read: missing keytype
debug1: identity file /home/prod_01/.ssh/id_rsa type 1
debug1: identity file /home/prod_01/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_4.3p2-hpn
debug1: match: OpenSSH_4.3p2-hpn pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.1
debug2: fd 4 setting O_NONBLOCK
debug3: RNG is ready, skipping seeding
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib
debug2: kex_parse_kexinit: none,zlib
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: mac_init: found hmac-md5
debug1: kex: server->client aes128-cbc hmac-md5 none
debug2: mac_init: found hmac-md5
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
debug2: dh_gen_key: priv key bits set: 132/256
debug2: bits set: 509/1024
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug3: check_host_in_hostfile: filename /home/prod_01/.ssh/known_hosts
debug3: check_host_in_hostfile: match line 1
debug1: Host '147.149.253.220' is known and matches the RSA host key.
debug1: Found key in /home/prod_01/.ssh/known_hosts:1
debug2: bits set: 509/1024
debug1: ssh_rsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /home/prod_01/.ssh/id_rsa (40063e50)
debug2: key: /home/prod_01/.ssh/id_rsa (400360c0)
debug2: key: /home/prod_01/.ssh/id_dsa (00000000)
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug3: start over, passed a different list publickey,password,keyboard-interactive
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /home/prod_01/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Offering public key: /home/prod_01/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Trying private key: /home/prod_01/.ssh/id_dsa
debug3: no such identity: /home/prod_01/.ssh/id_dsa
debug2: we did not send a packet, disable method
debug3: authmethod_lookup keyboard-interactive
debug3: remaining preferred: password
debug3: authmethod_is_enabled keyboard-interactive
debug1: Next authentication method: keyboard-interactive
debug2: userauth_kbdint
debug2: we sent a keyboard-interactive packet, wait for reply
debug2: input_userauth_info_req
debug2: input_userauth_info_req: num_prompts 1
Password:


Regards,
Pankaj

Last edited by pludi; 12-14-2009 at 05:41 AM.. Reason: code tags, please...
# 2  
Old 12-14-2009
Start with the first error message which is:
Code:
debug3: Not a RSA1 key file /home/prod_01/.ssh/id_rsa.
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug3: key_read: missing keytype
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug2: key_type_from_name: unknown key type '-----END'

The /home/prod_01/.ssh/id_rsa file does not contain what is expected, so recreate it.
# 3  
Old 12-15-2009
@TonyFullerMalv: That's an "normal" error message (if any error message can be normal). It just tells you that the key isn't a RSA1 key, which is deprecated anyways, as is SSHv1

These lines
Code:
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /home/prod_01/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Offering public key: /home/prod_01/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply

look like you're sending your private keys, but the remote server won't accept it. Are you sure you put your public key in ~/.ssh/authorized_keys? What are the permissions on the .ssh directory and the files within?

Last edited by pludi; 12-15-2009 at 03:10 AM..
# 4  
Old 12-15-2009
Quote:
Originally Posted by pludi
look like you're sending your private keys, but the remote server won't accept it. Are you sure you put your public key in ~/.ssh/authorized_keys2? What are the permissions on the .ssh directory and the files within?
shouldn't it be in ~/.ssh/authorized_keys?
# 5  
Old 12-15-2009
Yes, you're right, my bad. Corrected it.
# 6  
Old 12-15-2009
permission for .ssh dir is 755 and id_rsa and id_rsa.pub is 644

---------- Post updated at 03:12 AM ---------- Previous update was at 03:10 AM ----------

I'm just confused that why it is taking the two times the public key

debug2: key: /home/prod_01/.ssh/id_rsa (40063e50)
debug2: key: /home/prod_01/.ssh/id_rsa (400360c0)
debug2: key: /home/prod_01/.ssh/id_dsa (00000000)
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug3: start over, passed a different list publickey,password,keyboard-interactive

Regards,
# 7  
Old 12-15-2009
Quote:
permission for .ssh dir is 755 and id_rsa and id_rsa.pub is 644
Change .ssh to 700 and everything under it to 600.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sftp connection with password

I am running this script to copy pattern files in local but it is asking for password even passing the hardcode value Script:- PASSWORD="xyz" sftp -oport=1002 user@host:/dir/archive/file*.txt /di/data/ << EOF $PASSWORD quit EOF Got error :- -bash-4.1$ sh sftp_with_password.sh... (5 Replies)
Discussion started by: himanshupant
5 Replies

2. Red Hat

New sftp connection

Dear All , I have a openssh 4.3p2 , but i need to configure sftp for a user which is present in the server. This user has to see only the specific directory not all. I tried to do the changes in sshd_config for openssh 4.9p1 , but for openssh 4.3p2 how to do it. Any one pl help. ... (1 Reply)
Discussion started by: jegaraman
1 Replies

3. IP Networking

SFTP connection using two different users

Hi All This is regarding an SFTP Password less connection. I am logged into my local Server1 using username1. The remote server i have to connect is "Remoteserver1" with the "useriD" provided. I have already exchanged the public key and they are added to the authorized keys in the remote... (2 Replies)
Discussion started by: sparks
2 Replies

4. UNIX for Dummies Questions & Answers

SFTP: Connection problem

HI, I have generated public key and placed in remote server. When I am trying to do SFTP for that remote server the below error I am getting. Please help me to resolve Connecting to hostname... Sun_SSH_1.1.4, SSH protocols 1.5/2.0, OpenSSL 0x0090704f debug1: Reading configuration data... (4 Replies)
Discussion started by: rangarasan
4 Replies

5. Shell Programming and Scripting

Setup sftp connection

To set up a sftp connection between Server A, Server B and a website.com A batch script will start from Server A and Server B and Connect to the Website server How to setup sftp connection between server's. (1 Reply)
Discussion started by: aix_admin_007
1 Replies

6. Shell Programming and Scripting

How to check sftp connection

Hi All, in our system , the sftp server is continuously up. but suddenly it is brought down. how can i find out the reason behind of these , is their any log files or how can i check the connectvity with sftp. please help me to solve this issue (1 Reply)
Discussion started by: aish11
1 Replies

7. UNIX for Dummies Questions & Answers

SFTP Connection error

Hi I when I trying to SFTP a file to a server I am getting this below error: Connecting to 3.12.911.100... ssh_askpass: exec(/usr/lib/ssh/ssh-askpass): No such file or directory Host key verification failed. Connection closed Can you please help me in debugging this error. ... (3 Replies)
Discussion started by: krishna87
3 Replies

8. Solaris

Solaris 10 ftp connection problem (connection refused, connection timed out)

Hi everyone, I am hoping anyone of you could help me in this weird problem we have in 1 of our Solaris 10 servers. Lately, we have been having some ftp problems in this server. Though it can ping any server within the network, it seems that it can only ftp to a select few. For most servers, the... (4 Replies)
Discussion started by: labdakos
4 Replies

9. Shell Programming and Scripting

Password less connection(sftp/ssh)

Dear All, I'm trying to configure a passwordless connection between two servers of HP-UX. i have srearched the configuration in google so many times and as per the guidence i have done all the steps, but still its not working and every time it is asking for password while trying to scp some file... (2 Replies)
Discussion started by: panknil
2 Replies

10. UNIX for Advanced & Expert Users

SFTP Connection Closed

Hey when trying to connect to a server using a key I get sftp -o 'Port=22' -o'IdentityFile=/home/datatel/.ssh/id_dsa_xei' becker_xei@host Connecting to host... ANGEL SFTP ServerConnection closed by host Connection closed Any ideas? (1 Reply)
Discussion started by: ed.browne
1 Replies
Login or Register to Ask a Question