![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Script(s) to Automate Tasks | droppedonjapan | Shell Programming and Scripting | 2 | 05-21-2008 10:32 AM |
| script to automate mksysb via nim in AIX 5.3 | barkath | Shell Programming and Scripting | 0 | 12-20-2007 06:46 PM |
| here document to automate perl script that call script | hogger84 | Shell Programming and Scripting | 3 | 10-22-2007 10:15 AM |
| Automate batchfile generation for sFTP | mpang_ | Shell Programming and Scripting | 0 | 04-26-2006 05:34 AM |
| automate the input in a script | erwinspeybroeck | UNIX for Dummies Questions & Answers | 11 | 01-31-2002 10:54 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Quote:
|
|
||||
|
I am looking for a script that will allow me to automate file transfer via 'sftp'. key-gen is not an option as the 'client' (where we are 'getting' the files from) will mot permit us to generate the public/provate' keys for scp.
I have tried a number of examples shown and none of them work with sftp Each one either balks at the password or prompts for the password. Can someone show me a way to do this? Thanks. |
|
||||
|
Well if you can get the user keys working that will make things much easier.
Also, why don't you just use scp instead? Or maybe curl? Something like this... Code:
#!/bin/sh scp remoteuser@remotehost:/path/to/file.txt /path/to/local/target Last edited by STiVo; 06-15-2005 at 03:25 PM.. |
|
||||
|
use expect
using expect can get around the password verification issue.
Code:
/usr/local/bin/expect <<EOF spawn /usr/local/bin/sftp user@remotehost expect "password:" send "cd pub \r" expect "sftp> " send "ascii \r" expect "sftp> " send "get filename.txt \r" expect "sftp> " send "bye \r" EOF |
|
||||
|
Quote:
|
|
||||
|
automating sftp
All,
This is a great forum for beginners like me. I have been following this thread in its multiple forms on various websites. I got a good start by following this thread but got stuck after doing exactly what has been mentioned in this thread word by word. The pain area : it was still prompting me for a password everytime. Then, somebody suggested to recreate $HOME/.ssh directory again from scratch. Guess what, i did that and now i am able to log on from one server to another without being prompted for a password. I dont know how much this information is gonna be useful to ppl but sure proved the definite solution for me and i thought i probably should share it with everybody. Regards Vikas. |
![]() |
| Bookmarks |
| Tags |
| linux, linux commands, mtime, sftp script, solaris |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|