Re: Sheell Script for SFTP - Redhat
This is a discussion on Re: Sheell Script for SFTP - Redhat ; > This is what i tried but when i execute ./prg1.sh it hangs
>
> #!/bin/sh
> HOST='10.77.31.202'
> USER='root'
> PASSWD='venkat'
>
> ftp -n ${HOST}
> user {$USER} ${PASSWD}
> cd /root
> get test
> exit 0
...
-
Re: Sheell Script for SFTP
> This is what i tried but when i execute ./prg1.sh it hangs
>
> #!/bin/sh
> HOST='10.77.31.202'
> USER='root'
> PASSWD='venkat'
>
> ftp -n ${HOST} << EOF
> user {$USER} ${PASSWD}
> cd /root
> get test
> exit 0
> EOF
Hi Ian,
FTP may be disabled can we the same functionality like transferring the
files without prompting for a password using either sftp or scp?
If so what else needs to be modified in the above to acheive it.
Regards,
Venkat
-
Re: Sheell Script for SFTP
On Mon, 5 Sep 2005 17:51:47 +0530, "Venkat"
wrote:
>
>> This is what i tried but when i execute ./prg1.sh it hangs
>>
>> #!/bin/sh
>> HOST='10.77.31.202'
>> USER='root'
>> PASSWD='venkat'
>>
>> ftp -n ${HOST} << EOF
>> user {$USER} ${PASSWD}
>> cd /root
>> get test
>> exit 0
>> EOF
>
>Hi Ian,
>
>FTP may be disabled can we the same functionality like transferring the
>files without prompting for a password using either sftp or scp?
>If so what else needs to be modified in the above to acheive it.
>
>Regards,
>Venkat
>
If you want to use scp or sftp, I would create an RSA key for
authentication so you won't be prompted for a password. There's
several good faqs/guides on the web if you search.
-
Re: Sheell Script for SFTP
On Mon, 5 Sep 2005 17:51:47 +0530, "Venkat"
wrote:
>
>> This is what i tried but when i execute ./prg1.sh it hangs
>>
>> #!/bin/sh
>> HOST='10.77.31.202'
>> USER='root'
>> PASSWD='venkat'
>>
>> ftp -n ${HOST} << EOF
>> user {$USER} ${PASSWD}
>> cd /root
>> get test
>> exit 0
>> EOF
>
>Hi Ian,
>
>FTP may be disabled can we the same functionality like transferring the
>files without prompting for a password using either sftp or scp?
>If so what else needs to be modified in the above to acheive it.
>
>Regards,
>Venkat
>
Check your syntax...
host1:~$ TEST='asdf'; echo {$TEST}
{asdf}
host1:~$ TEST='asdf'; echo ${TEST}
asdf
-
Re: Sheell Script for SFTP
use bye instead of exit
--
artsyla
-----------------------------------------------------------------------
artsylar's Profile: http://usenetlinux.com/member.php?userid=505
View this thread: http://usenetlinux.com/showthread.php?t=47427