Operating System - HP-UX
1834246 Members
2526 Online
110066 Solutions
New Discussion

SFTP - without supplying password

 
SOLVED
Go to solution
DShinn
Frequent Advisor

SFTP - without supplying password

The server that I need to sftp from is running OpenSSH_4.4p1-hpn12v11 HP-UX Secure Shell-A.04.40.006 installed on HP-UX 11.11. The ssh-keygen has been executed and the dsa and rsa public and private keys are in the /home/user-id/.ssh directory. The remote server is a Linux system running F-Secure software version 3.2.9 SSH 3.2.3. The remote server requires that we use /home/different-user-id/.ssh2. The id_dsa.pub key created on the HP system has been put on the Linux server and a file called authorization has also been created on the remote server that includes the following:
Key id_dsa.pub. Also when I issue an ls -al from the .ssh2 directory the following is shown.

drwx------ 2 601 502 4096 Dec 22 2006 ./
drwxrwx--- 4 601 502 4096 Feb 20 12:58 ../
-rw-r----- 1 601 502 15 Dec 22 2006 authorization
-rw-r----- 1 601 502 605 Dec 22 2006 id_dsa.pub

Have not been able to get the sftp to work without keying in the password. When I get this to work - this will be scripted to pull a file at a certain time every day.

Attached the output of the sftp -vvv different-user-id@hostname.

Has anyone had any problems going from OpenSSH to F-Secure on Linux? Any assistance with this would be greatly appreciated!

Thanks,

Dorothy
4 REPLIES 4
Kasper Hedensted
Trusted Contributor

Re: SFTP - without supplying password

Hi Dorothy,

On the remote server add this top and bottom line in the "id_dsa.pub" file:

---- BEGIN SSH2 PUBLIC KEY ----
ThisIsTheSSHKey
---- END SSH2 PUBLIC KEY ----

Also remember to remove the string "ssh-dsa" from your SSH key

Regards, Kasper
Bill Hassell
Honored Contributor
Solution

Re: SFTP - without supplying password

The most common error is adding the key to the authorized_keys directory. Each key in this file must exactly one long line so copy-paste using vi often scrambles the key by inserting new lines. If your Linux authorization file has two keys, then wc -l on that file should be 2. If not, delete the key(s) and add them back by creating the key into a file on HP-UX, ftp the file to Linux, then append it to the authorized_keys file:

cat hpux-key >> .ssh2/authorized_keys

The see that keys and lines are the same. Ypou can use vi but you have to fixup extra lines caused by wm and ai if set.


Bill Hassell, sysadmin
DShinn
Frequent Advisor

Re: SFTP - without supplying password

THANK-YOU to all that replied. Another source suggested that I issue the ssh-keygen to reformat the file. Once that was done and moved the file to the remote server. The next logon worked!

Thanks again!

Dorothy
DShinn
Frequent Advisor

Re: SFTP - without supplying password

Please see above post.