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
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?
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
Summary: Hello.... I just know the basic shell scripting. But i want to learn more on scripting. Actualy I want to write automated shell scripts in Linux. i need some links or good tutorials. i am unable to lo...
Summary: I have created a script in unix and that needs to be automated. The script spools some.csv files from oracle and then I have to sftp the files. I have to only use sftp because of security reasons. I t...
Summary: am looking for a simple script to SFTP a file between two Unix servers in a secure environment, i have used "sftp -b batchfile user@host" and placed the passwd in the batchfile but this does not see...