Hmm.
Use a here document.
You can change the escape character in telnet - example set to capital letter F
This sets the escape character, connects to some remote node, then exits.
Plus, you seem to be making several connections to the same host.
Hi,
I am having a problem with our AIX 4.3.3 Server accessing FTP. The error is " Connection Closed By Remote Host".
Scenario:
Since i put a default gateway on the server FTP connection is having a problem but when i remove the default gateway it will works fine..
Is there any way not... (1 Reply)
hi
i am trying to connect the frontend server using ssh
i got the following error
ssh_exchange_identification: Connection closed by remote host
can anyone help please (1 Reply)
Dear All,
Recently our server has been giving the error:
"ssh_ exchange-identification: Connection closed by remote host"
The error causes the server to become in accessible via ssh and the services are stopped/hung. The server has to be restarted to make it working normal again.
The... (3 Replies)
Hi Everyone,
Good day.
Scenario:
2 unix servers -- A (SunOS) and B (AIX)
I have an ftp script to sftp 30 files from A to B which happen almost instantaneously i.e 30 sftp's happen at the same time.
Some of these sftp's fail with the following error:
ssh_exchange_identification: Connection... (1 Reply)
How do I gain control of the "Connection closed by foreign host" message telnet yields when you connect to it in a shell script? I'm using the output:
#!/usr/local/bin/bash
count=$(ping -c 1 $1 | grep 'received' | awk -F',' '{ print $2 }' | awk '{ print $1 }')
if ; then
echo "$1 PING "... (2 Replies)
I am trying to connect to my HP server from remote machine.
It gets connected but once credential are provided the connection is closed.
adroit:/home/seo/hitendra 32 ] telnet myserv1
Trying...
Connected to myserv1.
Escape character is '^]'.
Local flow control on
Telnet TERMINAL-SPEED... (4 Replies)
Version Details
Solaris version : Oracle Solaris 10 8/11 s10x_u10wos_17b X86
$ uname -a
SunOS tippy178 5.10 Generic_147441-01 i86pc i386 i86pcThe Issue
+++++++++
I have two solaris 10 Virtual Machines created using Virtual Box. One of my applications running on Source was trying to connect... (9 Replies)
Hi All,
I am new to Redhat Enterprise Linux 6 version. I am facing an issue with my lab server which is having RHEL6
lab1:root> uname -a
Linux lab1 2.6.32-358.18.1.el6.x86_64 #1 SMP Fri Aug 2 17:04:38 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux
I am getting this error for every 18 minutes 30... (0 Replies)
Hello Everyone,
My following script is giving me problems, when the SIP trunk goes down and the telnet session is started and just when the command is about to complete the connection is closed then script restarts.
I have noticed that as soon the script types in "sys re" or "sys rebo" or... (6 Replies)
Hello,
I'm trying to learn and automate some tasks via a script, but my first ever script failed with "connection closed by foreign host" error. I checked the other discussions but it didn't help. Could you please help?
#!/bin/bash
( sleep 2
echo open x.x.x.x 23
sleep 2
echo user
sleep 2... (1 Reply)
Discussion started by: Myrtle
1 Replies
LEARN ABOUT PLAN9
con
CON(1) General Commands Manual CON(1)NAME
con, telnet, cu, rx, xms, xmr - remote login, execution, and XMODEM file transfer
SYNOPSIS
con [ -dCrvs ] [ -l [ remuser ] ] [ -c cmd ] [net!]machine
telnet [ -dCrn ] [net!]machine
cu number
rx [ -n ] [net!]machine [ command-word ... ]
xms file
xmr file
DESCRIPTION
Con connects to the computer whose network address is net!machine and logs in if possible. With no options, the account name used on the
remote system is the same as that on the local system. Standard input and output go to the local machine.
Options are:
-l with an argument causes remuser to be used as the account name on the remote system. Without an argument this option disables auto-
matic login and a normal login session ensues.
-C forces cooked mode, that is, local echo.
-c runs cmd as if it had been typed as a command from the escape mode. This is used by cu.
-v (verbose mode) causes information about connection attempts to be output to standard error. This can be useful when trying to debug
network connectivity.
-d causes debugging information to be output to standard error.
-r suppresses printing of any carriage return followed by a new line. This is useful since carriage return is a printable character in
Plan 9.
-s strips received characters to 7 bits to forestall misinterpretation of ASCII with parity as UTF.
The control- character is a local escape. It prompts with the local machine name and >>>. Legitimate responses to the prompt are
i Send a quit [sic] signal to the remote machine.
q Exit.
b Send a break.
. Return from the escape.
!cmd Run the command with the network connection as its standard input and standard output. Standard error will go to the screen. This
is useful for transmitting and receiving files over the connections using programs such as xms.
Telnet is similar to con, but uses the telnet protocol to communicate with the remote machine. If standard input is a file or a pipe, the
-n option causes telnet not to hang up the connection when it receives EOF on its standard input; instead it waits for the remote end to
hang up. It shares con's -C, -d, and -r options.
Cu is a shell script that uses telco(4) and con to connect to a machine via a modem. If the machine is equipped with a local modem, it is
used. Otherwise, the call is placed through Datakit.
Rx executes one shell command on the remote machine as if logged in there, but with local standard input and output. A rudimentary shell
environment is provided. If the target is a Plan 9 machine, $service there will be rx.
Network addresses for both con and rx have the form network!machine. Supported networks are those listed in /net.
The commands xms and xmr respectively send and receive a single file using the XMODEM protocol. They use standard input and standard out-
put for communication and are intended for use with con.
EXAMPLES
rx kremvax cat file1 >file2
Copy remote file1 to local file2.
rx kremvax cat file1 '>file2'
Copy remote file1 to remote file2.
eqn paper | rx kremvax troff -ms | rx deepthought lp
Parallel processing: do each stage of a pipeline on a different machine.
SOURCE
/sys/src/cmd/con
for con, xms, and xmr.
/sys/src/cmd/ip
for telnet.
/rc/bin/cu
BUGS
Under rx, a program that should behave specially towards terminals may not: e.g., remote shells will not prompt. Also under rx, the remote
standard error and standard output are combined and go inseparably to the local standard output.
CON(1)