Solved

Connection Refused. REDHAT 6.2

Posted on 2001-08-20
9
490 Views
Last Modified: 2013-12-15
I have just installed RH 6.2 in office. But when I telnet to the box, it gives "connection refused". I can ping the box.

Any files which I must modify?

Thanks
0
Comment
Question by:Judy_M
  • 5
  • 2
  • 2
9 Comments
 

Expert Comment

by:sdc_phong
ID: 6408908
I think you should check the following:

1. Check if in.telnetd is installed (rpm -qf `which in.telnetd`). If it's not, install it (this is should installed by default, however)

2. Check if inetd or xinetd is installed
 (rpm -qa|grep inetd)

3. Check if inetd/xinetd is listen for telnet connection (netstat -na|grep :23)

4. If inetd is installed, check if a following line is present in your /etc/inetd.conf (grep telnet /etc/inetd.conf)

telnet  stream  tcp     nowait  root    /usr/sbin/tcpd  in.telnetd

5. If xinetd is installed, check if file /etc/xinetd.d/telnet doesn't contain something like
disable=true

Hope you can get it working.

Cheers.

Nguyen Thanh Phong.
0
 

Author Comment

by:Judy_M
ID: 6409073
Hi,

inetd was installed after reading your note.

xinetd is not installed.

The rest of the conditions you specified are met.

Now, the error is slightly different. Connection was closed *immediately* after I telnet to the box
Error Message --> Connection closed by foreign host.
0
 

Expert Comment

by:sdc_phong
ID: 6409116
Can you send the screen dump of the telnet session (from beginning to connection closed).

BTW, do you telnet in as root or normal user? If you did with root, try again with normal user. By default, root user is NOT ALLOWED to telnet to the host.

Cheers.

Nguyen Thanh Phong
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

Author Comment

by:Judy_M
ID: 6409538
Hi,

Here's the dump:

$telnet myhost
Trying 165.204.194.115...
Connected to myhost.blahblah.com.
Escape character is '^]'.
Connection closed by foreign host.
$
0
 
LVL 4

Expert Comment

by:MFCRich
ID: 6410880
The files '/etc/hosts.allow' and '/etc/hosts.deny' control access through inetd services. Check "man 5 hosts_access" for the details.
0
 

Author Comment

by:Judy_M
ID: 6411673
Hi,

inetd was installed after reading your note.

xinetd is not installed.

The rest of the conditions you specified are met.

Now, the error is slightly different. Connection was closed *immediately* after I telnet to the box
Error Message --> Connection closed by foreign host.
0
 

Author Comment

by:Judy_M
ID: 6411692
Both hosts.allow and hosts.deny has nothing in them.

But after adding ALL:ALL in hosts.allow, I still get the same error:

$telnet myhost
Trying 165.204.194.115...
Connected to myhost.blahblah.com.
Escape character is '^]'.
Connection closed by foreign host.
$
0
 

Author Comment

by:Judy_M
ID: 6412004
Updates:

$ftp myhost
Connected to myhost.blahblah.com.
421 Service not available, remote server has closed connection

In my inetd.conf, I have:
ftp stream tcp nowait root /usr/sbin/tcpd in.ftpd -l -a
telnet stream tcp nowait root /usr/sbin/tcpd in.telnetd
........
........

Thanks.
0
 
LVL 4

Accepted Solution

by:
MFCRich earned 50 total points
ID: 6414889
Do you have a file '/usr/sbin/tcpd'? I believe it is part of the tcpwrappers package. Also inetd may need to be restarted if you touched any if its configuration files.

> /etc/rc.d/init.d/inet restart   # Restart inetd
or
> /etc/rc.d/init.d/inet status    # check status of inetd

Also check to see if inetd is set to start at boot time;

> chkconfig --list  inet # as root

The above command will show whether inetd is configured to start for each run level

> chkconfig --level 345 inet on # also as root

will set it so inetd starts up in run levels 3, 4, and 5 which is most likely what you want.

0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Install Predefined Certificate on Ubunto 4 37
CENTOS DHCP Server / PXE/TFTP 14 66
VMware Tools Install On Linux Problem 3 55
number in printf 13 25
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now