Configured sftp still requires password


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Configured sftp still requires password
# 8  
Old 03-26-2008
Thanks grial. It is odd indeed. I had tried rsa before dsa and here is the outcome of the re-try:

debug1: send SSH2_MSG_SERVICE_REQUEST
debug1: got SSH2_MSG_SERVICE_ACCEPT
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Trying public key: /home/testuser/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Trying public key: /home/testuser/.ssh/id_dsa
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: password
testuser@rmt_srvr's password:

Still asking for the password!!
# 9  
Old 03-26-2008
very strange. Try cleaning up the keys file on the remote end.
1. move the .ssh/authorized_keys file out of the way (rename it to something).
2. scp the public backover
3. on the remote end rename the public key you just scp'd over to be .ssh/authorized_keys
4. logout and try again

On my system (OpenSSH_4.7p1, OpenSSL 0.9.8g 19 Oct 2007 on Archlinux testing to OpenSSH.4.3.p2_Debian-9 on Debian Etch) I get the following:

debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /home/chris/.ssh/identity
debug1: Trying private key: /home/chris/.ssh/id_rsa
debug1: Offering public key: /home/chris/.ssh/id_dsa
debug1: Server accepts key: pkalg ssh-dss blen 435
debug1: read PEM private key done: type DSA
debug1: Authentication succeeded (publickey).

I assume the different messages are just because of different versions, possibly.
# 10  
Old 03-26-2008
PS don't forget to check the ownership and permissions on the files in ~/.ssh/

I like to keep mine very restrictive at 0700 for the directory and 0600 for the files, the maximum that OpenSSH seems to allow is 0644 for the files.
# 11  
Old 03-26-2008
Thanks wempy.

I had done all these "tricks" before posting my request here.
I believe it is somewhere deep in either OpenSSH and/or Solaris 8!!
# 12  
Old 03-26-2008
Tools

Let's step back a second and revisit the key pair that you'd generated. From your post:

Quote:
I used 'ssh-keygen -b 1024 -P "" -t dsa' to generate the Public-Key
Passphrase has apparently gained the misnomer of equal to the password, unfortunately. It's not, and it's intended to serve as a means to ensure public sharing of the key-pair without granting full account access to the remote host. Also, you don't need (or want) to specify your passphrase (ie, -P "") on the command-line, as it can be used against you, should anyone gain access to your key-pair and/or .sh_history file.

Instead of using -P (which is really intended to allow for revision of the passphrase in a given key-pair), let the ssh-keygen program prompt you for your passphrase. Leave all other switches as they are, but scratch the
Code:
-P ""

options. The program will prompt you for the empty passphrase..to which you'll just enter twice. It doesn't matter what key type you're creating either..same goes for rsa and dsa.

Lastly, just be sure that you're placing the Public Key into the remote user's .ssh directory as well. You don't have to have identical users between the machines..or even have separate machines for that matter (ie, unilover@localhost can access unilever@localhost, much the same as unilover@localhost can access unilever@remotehost or unilover@remotehost). So long as the key placement is done right..you can automate the login with an empty passphrase.

HTH
# 13  
Old 03-26-2008
Thanks curleb.

I regenerated the Public-Key on the localhost per your instructions and copied the contents to the .ssh/authorized_keys on the remotehost.

Mind you, NOTHING CHANGED!!

Had I to copy over the "id_dsa & id_dsa.pub" pair of files too?!?!
# 14  
Old 03-26-2008
No, only the .pub file goes to the remote location..you cat it into the ~/.ssh/authorized_keys file and scratch the original .pub file.

One thing I'd caution you on..and many of the SAs I deal with can't quite grasp: are you sudo or sesu or similar while trying to do any of this? This throws off the EID of the process and SSH won't let on, for obvious reasons.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sftp with password

I have been tasked with scripting a sftp transfer from my clients sftp server to a vendor. I have been given a user name and password. This is an older OEL server, 5.2. I am not able to install any packages on this system. It does not have expect, ssh-pass, or any other ssh password helper... (6 Replies)
Discussion started by: mtrgoose
6 Replies

2. Shell Programming and Scripting

SFTP prompting for password even though password is in script

Hi All, I am trying to transfer a file from one server to a remote server using SFTP. Client is not ready for key setup. I am working on Solaris 10. Here is the code. #!/bin/ksh # sample automatic Sftp script to dump a file USER="user1" PASSWORD="pass1" HOST="host1" sftp $USER@$HOST... (6 Replies)
Discussion started by: megha2525
6 Replies

3. Red Hat

prompting for passwords even i configured ssh password less authentication

There are two servers : 1. Site 2. Testing from site server i want to connect testing server with ssh password less authentication. i generated public and private keys with ssh-keygen -t rsa on site server. cat id_rsa >> authorized_keys cat id_rsa.pub >> authorized_keys i... (15 Replies)
Discussion started by: rehantayyab82
15 Replies

4. Shell Programming and Scripting

SFTP with Password

Hi Guys, I need to know how can i achieve SFTP "with" password in a shell script. I have already done passwordless key generation thing and it is working but at the moment i am interested in passing a password. And another question I have is say i have a.ksh and b.sh scripts...Can i invoke... (6 Replies)
Discussion started by: Arpit Narula
6 Replies

5. Shell Programming and Scripting

sftp is asking password

Hi i have generate public private key pair using command ssh-keygen -t rsa -b 2048 and then it made the two keys under the directory ~/.ssh ( in server 1) one is public key and another one is private .. i copied public one key onto my second server under the directory ... (22 Replies)
Discussion started by: aishsimplesweet
22 Replies

6. Shell Programming and Scripting

password - SFTP

Hi team, I know if we need to transfer the files between between 2 servser, we use SFTP through key setup between 2 server. currently There are some problems and we are not able to setup keys between servers. How can i use password with SFTP for temporary solutions, so that the file... (6 Replies)
Discussion started by: Amit.Sagpariya
6 Replies

7. Shell Programming and Scripting

Script check if ssh requires a password???

Thanks to the help from this forum i've learned a lot of good stuff but I still have questions :). I need to write a script that checks if ssh to a box requires a password. I need it will be an "if" statement, if ssh requires password, then do a key exchange(with i already have). Just need to... (5 Replies)
Discussion started by: elbombillo
5 Replies

8. Shell Programming and Scripting

SFTP error:-b requires an argument greater than zero

Hi when i execute the below command sftp -b ftpCommand.ksh remoteuser@remoterserver i am getting the error "-b requires an argument greater than zero" Please can any one help me. (4 Replies)
Discussion started by: vgs
4 Replies

9. UNIX for Advanced & Expert Users

SFTP error:-b requires an argument greater than zero

Hi when i execute the below command sftp -b ftpCommand.ksh remoteuser@remoterserver i am getting the error "-b requires an argument greater than zero" Please can any one help me. (1 Reply)
Discussion started by: vgs
1 Replies
Login or Register to Ask a Question