LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 02-25-2002, 09:48 PM   #1
gopi_20us
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
ftp
and then use
open <host_name>
userid
<passwd>
Would you please confirm this is correct.

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

Rep: Reputation: 46
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
 
Old 02-26-2002, 08:09 AM   #3
gopi_20us
LQ Newbie
 
Registered: Feb 2002
Posts: 9

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

Hi MIK,

Thanks for all your help.It worked .
 
Old 02-26-2002, 11:03 PM   #4
crabboy
Moderator
 
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, 04:04 PM   #5
kervin
Member
 
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.
 
  


Reply


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
ssh_exchange_identification: Connection closed by remote host piter23 Linux - Software 17 09-11-2013 09:59 AM
Can't SSH to remote machine: Connection closed by remote host Avatar Linux - Networking 34 05-24-2013 09:28 AM
Remote connection UNKNOWN host scoban Linux - Networking 2 07-14-2005 10:09 AM
rndc: connection to remote host closed. james.farrow Fedora 2 06-16-2004 11:40 AM
ssh_exchange_identification: Connection closed by remote host ctav01 Linux - Networking 1 08-22-2003 07:14 PM


All times are GMT -5. The time now is 09:55 AM.

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