remote host connection script question???
Hi all,
How to connect remote host from a unix script.I know first use ftp and then use open <host_name> userid <passwd> Would you please confirm this is correct. Thanks in advance. Gopi. |
Yes that is how you would connect manually. But if you just put those commands in the script it won't work. Ftp requests an automatic login which you disable with the -n switch. After that you have to redirect the script commands to the input of the ftp process. Try something like:
#!/bin/sh # simple ftp script ftp -n <<EOF open servername user username password put filename quit EOF |
Thanks MIK it worked .
Hi MIK,
Thanks for all your help.It worked . |
If you have ncftp installed, it comes with command line versions.
ncftpget and ncftpput. |
for security I'd suggest the scp program that comes with ssh. With ssh and scp you can setup public key authentication.
|
All times are GMT -5. The time now is 02:53 PM. |