Ask Leo! by Leo A. Notenboom

How can I automate an SFTP transfer between two servers?

Search First! Then browse: Categories | Full Archive | By Date | Newsletter

Home » General Computing

Comments

Read the article that everyone's commenting on.
RSS feed Subscribe to the RSS Feed for comments on this article.

Comment Page:  1  |  2  |  3  |  4  |  5 

Hi Leo,
I am also following all the steps but SFTP is still asking me the password. I am having SunOs and Global Scape OS and I am trying to do automation from SunOS to GlobalScape. Is there any compatible problem. Please guide

Posted by: Amit Gupta at October 18, 2006 1:30 AM

I'm trying to write a script to connect to a server via sftp that has publickey+password authentication. Even when I put the password in a file and use the -b option, it still prompts me for a password. Is there any other way to pass the password to the remote server?

Posted by: Mike McGinn at November 17, 2006 7:35 AM

Well written article. More of this needed on the net. My batch job now works!!!

Posted by: Ian McDermid at December 27, 2006 3:34 AM

Hi Leo,
Nice article. I have one question though.
If I want to put a file from server1 to server2 - automatically - How do I do that?

If I do sftp user2@server2.com then it goes into interactive mode of sftp. But my problem is I want to put a file from server1 to server2 - using sftp command not from interactive prompt.

any clues on that please?

Regards
Kumar

Posted by: kumar at January 3, 2007 2:47 AM

Check out the gazillion command line options for sftp. You can bypass the interactive prompt by specifying everything on the command line.

Posted by: Leo Notenboom at January 3, 2007 9:12 AM

Hi, We need to create a kshell script to FTP files to the destination server. We have to use sftp to do so.

My concern is, how do I avoid getting password prompt when using sftp command. Please help, it is very urgent.

Thanks in advance.

Regards, Minesh Shah

Posted by: Minesh Shah at March 2, 2007 4:24 AM

Hi Leo,
Your instructions to automate my sftp transfers worked great! I've only run into one problem. When I try to change user1 on server1 to point to user3 on server2, it starts prompting for a password again. i.e. sftp user2@server2.com works fine but sftp user3@server2.com doesn't work automatically. I copied the public key from the .ssh folder on user2 over to the .ssh folder for user3 but that doesn't seem to help. What am I missing here?

Regards,
James

Posted by: James at March 29, 2007 5:26 PM

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Nine times out of ten, the permissions on the copy of the .ssh files and the
authorized_keys file that you copied are wrong. It needs to be owned by the
account who's .ssh directory it resides in.

Leo
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)

iD8DBQFGDHLeCMEe9B/8oqERAureAJ9CmSJMmSetKZZV8UaFGH2JVXRBswCbBd4I
xuTKYBGphXOrpANg7P3CqMY=
=izE9
-----END PGP SIGNATURE-----

Posted by: Leo Notenboom at March 29, 2007 7:16 PM

We have the lprng daemon running. When we put a job on a queue, it calls a shell filter script that is suppose to sftp the file to the remote server.

The problem is, the daemon tries to connect to the remote host even though we specify the user@host2 (user is qadmin and has the keys set up both sides).

ie: scp -b qadmin@host2

Posted by: Rajesh Acharya at April 2, 2007 5:39 AM

Hi Leo,great advice. One additional question, if the account doesn't have a standard login shell will this automat process work?

Posted by: sai at April 4, 2007 6:31 AM
Comment Page:  1  |  2  |  3  |  4  |  5 
Read the article that everyone's commenting on.
RSS feed Subscribe to the RSS Feed for comments on this article.
Post a Comment

Question? Ask Leo!