Computing.Net > Forums > Unix > Automated SFTP Script

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Automated SFTP Script

Reply to Message Icon

Name: sankarjune14
Date: July 6, 2005 at 02:23:12 Pacific
OS: Sun Solaris
CPU/Ram: 512 MB
Comment:

I am trying to create a new script which needs to upload/download files by using SFTP protocol. For that, I would like to automate that script. I know that sftp command is having a option to process those commands in a batch file by using -b option.

I tried as follows:

sftp -bmybatfile username@host

In mybatfile:
passwd
get *.lst
quit

While running the command, it is asking for password. But, I already mentioned the password in the batchfile. Since I need to connect some other external server's SFTP, it is hard to get the authentication key and install the same in my box. So, can you guys let me know what is the problem with the script?

Thanks in advance

Sudhakar



Sponsored Link
Ads by Google

Response Number 1
Name: Luke Chi
Date: July 11, 2005 at 11:54:12 Pacific
Reply:

1. -b batchfile
Batch mode. Reads commands from a file instead of standard input.
Since this mode is intended for scripts/cronjobs, sftp2 will not
try to interact with user, which means that only the passwordless
authentication methods will work. In batchmode, a failure to
change the current working directory will cause the sftp2 to
abort. Other errors are ignored.

2. Sftp uses ssh2 in data connections,
so the file transport is secure.

3. So, set up ssh according to your ssh version to remove the need to interactively input the username and password.


Luke Chi


0

Response Number 2
Name: mikeprotts
Date: August 31, 2005 at 12:14:13 Pacific
Reply:

We have a product SFTPPlus designed for this purpose. Check www.sftpplus.com

Cheers
Mike


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Automated SFTP Script

Automate shell scripts www.computing.net/answers/unix/automate-shell-scripts/6104.html

sftp unix script www.computing.net/answers/unix/sftp-unix-script/7434.html

SFTP script www.computing.net/answers/unix/sftp-script/5772.html