Passwordless sftp issue


 
Thread Tools Search this Thread
Operating Systems Solaris Passwordless sftp issue
# 1  
Old 12-17-2013
Passwordless sftp issue

Hello Experts,

I am trying to setup passwordless sftp from one of linux box to solaris box.

I have generated key-pair and below is the permissions of the respective files.

Code:
drwx------. 2 sftpuser sftpuser 4096 Dec 17 23:57 .ssh

drwx------. 2 sftpuser sftpuser 4096 Dec 17 23:57 .
-rw-r--r--. 1 sftpuser sftpuser  609 Dec 17 23:57 id_dsa.pub
-rw-------. 1 sftpuser sftpuser  668 Dec 17 23:57 id_dsa
-rw-r--r--. 1 sftpuser sftpuser  220 Dec 17 23:45 known_hosts
-rw-------. 1 sftpuser sftpuser 1675 Dec 17 23:44 id_rsa
-rw-r--r--. 1 sftpuser sftpuser  401 Dec 17 23:44 id_rsa.pub
drwx------. 5 sftpuser sftpuser 4096 Dec 17 23:40 ..

I copied id_rsa.pub using sftp to my solaris box and while trying to connect using public key it is still asking for password as shown in below snapshot.

Code:
bash-3.00$ sftp -o IdentityFile=id_rsa.pub sftpuser@IP
Connecting to IP...
sftpuser@IP's password:

Am I missing something here? Are there any configs that needs to be made for password less ssh to work..

Thanks in Advance for your kind help..

Last edited by Corona688; 12-17-2013 at 01:31 PM..
# 2  
Old 12-17-2013
You don't copy the public key to the remote side, you append it to authorized_keys.
# 3  
Old 12-17-2013
If still problem exists, run
Code:
ssh -vv user@IP

and post the output here.
# 4  
Old 12-17-2013
Hi All,

Problem still persists even after appending public key to authorized_keys.

Here is the output of ssh -v

Code:
bash-3.00$ ssh -v sftpuser@IP
Sun_SSH_1.1, SSH protocols 1.5/2.0, OpenSSL 0x0090704f
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Rhosts Authentication disabled, originating port will not be trusted.
debug1: ssh_connect: needpriv 0
debug1: Connecting to IP [IP] port 22.
debug1: Connection established.
debug1: identity file /export/home/nxtusr1/.ssh/identity type -1
debug1: identity file /export/home/nxtusr1/.ssh/id_rsa type 1
debug1: identity file /export/home/nxtusr1/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-Sun_SSH_1.1
debug1: Failed to acquire GSS-API credentials for any mechanisms (No credentials were supplied, or the credentials were unavailable or inaccessible
Unknown code 0
)
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: Peer sent proposed langtags, ctos:
debug1: Peer sent proposed langtags, stoc:
debug1: We proposed langtags, ctos: i-default
debug1: We proposed langtags, stoc: i-default
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: dh_gen_key: priv key bits set: 128/256
debug1: bits set: 996/2048
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'IP' is known and matches the RSA host key.
debug1: Found key in /export/home/nxtusr1/.ssh/known_hosts:14
debug1: bits set: 1063/2048
debug1: ssh_rsa_verify: signature correct
debug1: newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: done: ssh_kex2.
debug1: send SSH2_MSG_SERVICE_REQUEST
debug1: got SSH2_MSG_SERVICE_ACCEPT
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: gssapi-keyex
debug1: Next authentication method: gssapi-with-mic
debug1: Failed to acquire GSS-API credentials for any mechanisms (No credentials were supplied, or the credentials were unavailable or inaccessible
Unknown code 0
)
debug1: Next authentication method: publickey
debug1: Trying private key: /export/home/nxtusr1/.ssh/identity
debug1: Trying public key: /export/home/nxtusr1/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Trying private key: /export/home/nxtusr1/.ssh/id_dsa
debug1: Next authentication method: password
sftpuser@IP's password:

# 5  
Old 12-18-2013
Oracle

How did you generate the public key using what protocol?
Can You please paste initial 2 lines of your public key?
# 6  
Old 12-18-2013
Hi,

I used rsa.

Here is first two lines of public key.

Code:
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAtvWvGQMIpwuUxaMEShLkxw1BiAo9MHlrMI6rfjM8C+bfhzMxk7wXvtX/6M5Q3qLRxtb8YRgow9p81IJ7geDqbf3tETPh5G8NF6h8OkdfSssUC5phEic8D7tXXN+UM+jBj8aN
KunjAfXFiXzHRW1FHy6T5RDOHBdnZtXgaEI

# 7  
Old 12-18-2013
do you have the authorized_keys at your destination??

$HOME/.ssh/authorized_keys?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to use passwordless sftp in script?

Hi I am trying to do SFTP in shell script in such a way that it should not ask for password. for this is use below script but it prompt for password. here I am not abled to understand where I am making mistake. #!/bin/bash # SFTP TO remote server USER="ITO" PASSWORD="abcd@1234"... (4 Replies)
Discussion started by: scriptor
4 Replies

2. Windows & DOS: Issues & Discussions

Passwordless sftp connection from UNIX to windows server

HI , I am trying to make a passwordless sftp connection from a unix server to windows server I have used a existing script which is like this cd /home150/adm/.ssh/ ssh-agent /usr/bin/ksh <<EOF ssh-add IDBNEWKEY ssh-add -l sftp IDBUSER@abc.com cd /home/IDBUSER/Share/IDB/ rm ${FILE}... (0 Replies)
Discussion started by: Jcpratap
0 Replies

3. Shell Programming and Scripting

Passwordless file transfer using sftp

Hello all, I have a requirement, in which we need to stage a package to Unix remote server in an automation (we cant use ssh key generation) , do u have any idea how we can transfer the package to remote server using sftp .if you have any script plz share it to me (4 Replies)
Discussion started by: Ramji Sundaram
4 Replies

4. Shell Programming and Scripting

Passwordless SFTP - SCP Option?

I have read documentation on SCP and just trying to figure out how go about doing this - below are two pieces of code, one is SFTP and one is SCP. My goal is to have this done via password-less authentication, fully automated. Currently we use SFTP and the script asks for the password of the... (20 Replies)
Discussion started by: Stigy
20 Replies

5. Cybersecurity

SFTP passwordless (kind of works)

Hi, I set up the keys on local and remote server. If I simply do: sftp xxx.xxx.xxx.xxx It works without asking for a password. But if I change the command to: sftp user@server it prompts me for password. Anybody know how to rectify this? Thanks a bunch. EDIT: I copied the key... (3 Replies)
Discussion started by: tetra
3 Replies

6. Shell Programming and Scripting

passwordless sftp with debug options

Hi, In our project we already have a passwordless sftp with -b (batchfile) option working but there have been some new application rolled out at the client site and they want us to raise the DEBUG option somebody suggested to use following options with sftp command -oLogLevel=DEBUG... (4 Replies)
Discussion started by: dips_ag
4 Replies

7. Shell Programming and Scripting

keypair generation for passwordless sftp

Hi, I want to establish a passwordless sftp between the two servers. I've searched the net and know the steps to be taken; which are as follows: $ ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (~/.ssh/id_rsa): ~/.ssh/id_rsa already... (3 Replies)
Discussion started by: dips_ag
3 Replies

8. Shell Programming and Scripting

passwordless authentication of SFTP script

Dear All I need to discuss about the problem which has been discussed so many times here. I need to transfer a file from server A to server B via passwordless SFTP script. By reading the threads on this topic here, I followed the below steps but still it's not working .. Pls find the steps... (13 Replies)
Discussion started by: uday.shankar
13 Replies

9. Shell Programming and Scripting

Passwordless SFTP

Hi, When Iam trying to do SFTP it is asking for password everytime. Can I have any alternative where I can provide the password in script itself. Because there are some control-M jobs which runs without user interaction. So please let me know the script where we can provide the password in the... (2 Replies)
Discussion started by: manneni prakash
2 Replies

10. Shell Programming and Scripting

Passwordless sftp from UNIX to windows site

Hallo all , I researched many article in this forum as well as googled. But could not get any help. I request the forum to extend some help. Issue: Want to do a passwordless sftp from an unix machine to windows action taken : 1) on local unix machine ssh-keygen -t dsa 2) Next step ,... (2 Replies)
Discussion started by: konark
2 Replies
Login or Register to Ask a Question