Operating System - HP-UX
1821061 Members
2519 Online
109631 Solutions
New Discussion юеВ

How to automate secure FTP password

 
Steve_615
Occasional Advisor

How to automate secure FTP password

Hi,

Does anyone have ideas on how to automate an SFTP login, so that I do not get prompted for a password. We are trying to script this SFTP transfer and it always stops at the prompt for the login password.

Thanks for any of your help
5 REPLIES 5
Denver Osborn
Honored Contributor

Re: How to automate secure FTP password

Are you using public key authentication?

If you're public key has been put in the target's ~/.ssh/authorized_keys file, test it out with this syntax. If there is a problem, the verbose output should help with troubleshooting.

sftp -v -o preferredauthentications=publickey hotname

If you haven't setup a key, search the forums for "ssh authorized keys". There are plenty of threads out there to show you how to set it up.

hope this helps,
-denver
Nguyen Anh Tien
Honored Contributor

Re: How to automate secure FTP password

Hi Steve
this is answer
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=840714
choose Perter solution
HTH
tienna
HP is simple
Noel Miranda
Frequent Advisor

Re: How to automate secure FTP password

Steve_615
Occasional Advisor

Re: How to automate secure FTP password

I've set up the keys and did not put in a passphrase (just hit enter) and I still get prompted for a password. Getting very frustrating.

Can the problem be on the remote server side?? I am SFTP'ing from an HP-UX 11.i server to a Linux 2.6.9 server. Is this something that should work??

All your help has been appreciated.

I may try to test this HP to HP just to see if I can get it working.

What about the ssh_config file??? Can this be the source of the problem?

Thanks,

Steve
Ermin Borovac
Honored Contributor

Re: How to automate secure FTP password

Problem could be incorrect permissions on $HOME/.ssh directory and files on the Linux (server) side.

Make sure that directory $HOME/.ssh and all files in it, on the Linux box, are not group/world writable.

Also check /etc/ssh/sshd_config on the Linux side (location of sshd_config could be different depending on your distribution) and make sure the following lines are set correctly.

PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
Subsystem sftp /usr/libexec/openssh/sftp-server

If you modify sshd_config don't forget to restart sshd.