![]() |
|
|
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 |
| sftp/scp/ssh script with password as authentication | james_falco | HP-UX | 4 | 05-27-2009 03:04 PM |
| Reg sftp in shell script | vidhya_vec | Shell Programming and Scripting | 3 | 11-26-2008 12:30 AM |
| SFTP shell script help | madankumar | Shell Programming and Scripting | 1 | 07-26-2008 09:34 AM |
| how to give sftp a password in a shell scripit | kskywr | Shell Programming and Scripting | 3 | 12-14-2006 12:55 AM |
| Change the password in 30 days in sftp script. | rosh0623 | UNIX for Advanced & Expert Users | 3 | 08-24-2005 12:39 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
SFTP in Shell Script with RSA-KEY or password.
I am trying to SFTP to a couple sites. One has an RSA-KEY that was sent to me. Currently I am running that manually using WinSCP. I would like to set it up as a CRON process on our Linux host (Sun).
Can I use the rsa-key they sent me in any directory or does it need to be placed in a specific directory? Can someone provide an example of a shell script that authenticates using the key and then "puts" the file on the sFTP host? My other SFTP host doesn't use keys. I have tried several ways to avoid the password prompt during my shell script. Our system doesn't recognize "spawn" when trying to use a batchfile. Here is an example of what I have now: <snip> #!/bin/ksh CURRENT_DIR=`/usr/bin/pwd` export CURRENT_DIR ORACLE_SID=$1 ; export ORACLE_SID ORAENV_ASK=NO ; export ORAENV_ASK . /usr/local/bin/oraenv # # sqlplus @szre_export.sql OUT_DIR=/home/me/AXIO FILEDATE=`date +%Y%m%d%H%M%S` chmod 666 $OUT_DIR/szre_extract.txt chmod 666 $OUT_DIR/szre_extract.txt umask 026 if [ -s $OUT_DIR/szre_extract.txt ] then cp $OUT_DIR/szre_extract.txt szremti_extract${FILEDATE}.txt chmod 666 szre_extract${FILEDATE}.txt else exit 0 fi #!/usr/local/bin/expect sftp myname@connect2ftp.theirhost.net << end_here expect "password:" send "secretpass\n"; interact put szre_extract${FILEDATE}.txt quit end_here exit <snip> I have tried several variations, and it continues to prompt for the password. I appreciate any help here! |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|