LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-10-2017, 08:28 AM   #1
shubha_nand
LQ Newbie
 
Registered: May 2017
Posts: 3

Rep: Reputation: Disabled
Connection closed by foreign host


Hi All,

Iam trying to telnet an database server from Linux machine, it shows connected after few seconds a message is displayed "connection closed by foreign host". Iam connecting through root user.

Could you please is telnet connecting to the database server? what does this message mean? and how to resolve it?
------------

telnet ORA.XXX.COM 1526
trying <IP Address>
connected to ORA.XXX.COM.
escape Character is ']'
Connection closed by foreign host


Thanks,
shubha
 
Old 05-10-2017, 08:32 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 23,453

Rep: Reputation: 7765Reputation: 7765Reputation: 7765Reputation: 7765Reputation: 7765Reputation: 7765Reputation: 7765Reputation: 7765Reputation: 7765Reputation: 7765Reputation: 7765
most probably the server waits for something.
Telnet connected to that given host/port successfully, but did not send any information over the line. That's why the foreign host closed the connection.
 
Old 05-10-2017, 08:37 AM   #3
shubha_nand
LQ Newbie
 
Registered: May 2017
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thank you for the information.
So, can we ignore this message? Or can we resolve if it is a issue?
Basically, if telnet is working fine then we need to write a script to telnet other servers and ports, so please let us know if we can go ahead even with this connection closed by foreign host message?

Thanks.
 
Old 05-10-2017, 08:37 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,416

Rep: Reputation: 8111Reputation: 8111Reputation: 8111Reputation: 8111Reputation: 8111Reputation: 8111Reputation: 8111Reputation: 8111Reputation: 8111Reputation: 8111Reputation: 8111
Quote:
Originally Posted by shubha_nand View Post
Hi All,

Iam trying to telnet an database server from Linux machine, it shows connected after few seconds a message is displayed "connection closed by foreign host". Iam connecting through root user.

Could you please is telnet connecting to the database server? what does this message mean? and how to resolve it?
------------

telnet ORA.XXX.COM 1526
trying <IP Address>
connected to ORA.XXX.COM.
escape Character is ']'
Connection closed by foreign host
And aside from what pan64 said...you are connecting to a server over a network, as ROOT...over TELNET???? That is possibly the most insecure thing I've heard about in many years. Telnet should NEVER be used, and logging in as root anywhere except the console should never be done. There is simply no reason for either...SSH should be used, and logging in as your 'regular' user should be fine.

And if you're using telnet just to TEST connectivity to a DB listener, it's not going to give you much more than a "yes you connected" type message like you got.
 
Old 05-10-2017, 08:42 AM   #5
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 23,453

Rep: Reputation: 7765Reputation: 7765Reputation: 7765Reputation: 7765Reputation: 7765Reputation: 7765Reputation: 7765Reputation: 7765Reputation: 7765Reputation: 7765Reputation: 7765
Quote:
Originally Posted by shubha_nand View Post
Thank you for the information.
So, can we ignore this message? Or can we resolve if it is a issue?
Basically, if telnet is working fine then we need to write a script to telnet other servers and ports, so please let us know if we can go ahead even with this connection closed by foreign host message?

Thanks.
I have no idea what do you want to achieve at all, so I cannot tell you what can you ignore or you how can go further.
As it was already stated using root account and telnet are not really suggested.
 
Old 05-10-2017, 08:43 AM   #6
shubha_nand
LQ Newbie
 
Registered: May 2017
Posts: 3

Original Poster
Rep: Reputation: Disabled
I tried with user account as well, I get the same message after few seconds.

Thanks.
 
Old 05-10-2017, 08:45 AM   #7
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 23,453

Rep: Reputation: 7765Reputation: 7765Reputation: 7765Reputation: 7765Reputation: 7765Reputation: 7765Reputation: 7765Reputation: 7765Reputation: 7765Reputation: 7765Reputation: 7765
yes, obviously it does not depend on that user id.
 
Old 05-10-2017, 08:52 AM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 26,459

Rep: Reputation: 6216Reputation: 6216Reputation: 6216Reputation: 6216Reputation: 6216Reputation: 6216Reputation: 6216Reputation: 6216Reputation: 6216Reputation: 6216Reputation: 6216
You can not connect to the database server using telnet. telnet uses ASCII and as far as I know Oracle uses a binary protocol. All you can tell from telnet is that some service is running on port 1526.

What are you actually trying to accomplish?

Last edited by michaelk; 05-10-2017 at 09:00 AM.
 
  


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
Telnet error- Escape character is '^]' and connection closed by foreign host sknsk Programming 5 05-02-2017 01:04 PM
telnet to a port on RHEL 6 : Connection closed by foreign host after a few seconds linuxuser26 Linux - Networking 1 08-11-2015 04:07 PM
Telnet: Connection closed by a foreign host DBrenchley Linux - Server 3 05-16-2014 01:49 AM
telnet - connection closed by foreign host rbumann Linux - General 11 01-05-2012 09:43 AM
[SOLVED] Connection closed by foreign host kumpaka Linux - Wireless Networking 3 01-02-2011 03:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration