Re: Sheell Script for SFTP
From: Ian East (ian.east_at_gmail)
Date: 09/01/05
- Next message: Ian East: "Re: Compelling reasons to upgrade from RH 6.0"
- Previous message: HASM: "Re: Sheell Script for SFTP"
- In reply to: Venkat: "Sheell Script for SFTP"
- Next in thread: Venkat: "Re: Sheell Script for SFTP"
- Reply: Venkat: "Re: Sheell Script for SFTP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 01 Sep 2005 12:28:26 -0700
On Thu, 1 Sep 2005 20:05:18 +0530, "Venkat" <khvenkat@cisco.com>
wrote:
>Hi All,
>
>I am looking for a shell script for SFTP a file and not prompting for the
>password.
>I wrote the small script but it doesn't work. I am trying to download the
>file by name test located at /root directory on System with IP 10.77.31.202.
>The userid and password of 10.77.31.202 is root and venkat. Could some one
>correct this please.
>
>#! /bin/sh
>
>HOST='10.77.31.202'
>USER='root'
>PASSWD='venkat'
>
>ftp $HOST
>user ${USER} ${PASSWD}
>
>cd /root/
>get test
>
>exit 0
>
>
>Regards,
>Venkat
>
Have you tried using a here document? I'm not that familiar with
sftp, but perhaps you could make this more secure and get around the
password by using RSA authentication.
#! /bin/sh
HOST='10.77.31.202'
USER='root'
PASSWD='venkat'
ftp $HOST<<EOF
user ${USER} ${PASSWD}
cd /root/
get test
exit 0
EOF
- Next message: Ian East: "Re: Compelling reasons to upgrade from RH 6.0"
- Previous message: HASM: "Re: Sheell Script for SFTP"
- In reply to: Venkat: "Sheell Script for SFTP"
- Next in thread: Venkat: "Re: Sheell Script for SFTP"
- Reply: Venkat: "Re: Sheell Script for SFTP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|