Share your knowledge at the LQ Wiki.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 02-25-2002, 10:48 PM   #1
LQ Newbie
Registered: Feb 2002
Posts: 9

Rep: Reputation: 0
remote host connection script question???

Hi all,

How to connect remote host from a unix script.I know first use
and then use
open <host_name>
Would you please confirm this is correct.

Thanks in advance.
Old 02-26-2002, 08:34 AM   #2
Senior Member
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
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:

# simple ftp script

ftp -n <<EOF
open servername
user username password
put filename
Old 02-26-2002, 09:09 AM   #3
LQ Newbie
Registered: Feb 2002
Posts: 9

Original Poster
Rep: Reputation: 0
Thanks MIK it worked .


Thanks for all your help.It worked .
Old 02-27-2002, 12:03 AM   #4
Senior Member
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,823

Rep: Reputation: 120Reputation: 120
If you have ncftp installed, it comes with command line versions.

ncftpget and ncftpput.
Old 03-01-2002, 05:04 PM   #5
Registered: Jan 2002
Location: Melbourne, FL.
Distribution: redhat
Posts: 168

Rep: Reputation: 30
for security I'd suggest the scp program that comes with ssh. With ssh and scp you can setup public key authentication.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't SSH to remote machine: Connection closed by remote host Avatar Linux - Networking 35 10-23-2017 01:21 AM
ssh_exchange_identification: Connection closed by remote host piter23 Linux - Software 17 09-11-2013 10:59 AM
Remote connection UNKNOWN host scoban Linux - Networking 2 07-14-2005 11:09 AM
rndc: connection to remote host closed. james.farrow Fedora 2 06-16-2004 12:40 PM
ssh_exchange_identification: Connection closed by remote host ctav01 Linux - Networking 1 08-22-2003 08:14 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:12 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration