LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices



Reply
 
Search this Thread
Old 04-01-2006, 02:08 AM   #1
sreeramabsc
LQ Newbie
 
Registered: Jan 2006
Posts: 13

Rep: Reputation: 0
Can ping to localhost but cannot telnet


Hello friends,
I am very much new to networking. I have some issues with telnet.

I have installed RedHat 9.0 on my PC. I have two network cards, eth0 and eth1. The IP addresses are as follows:

(a) eth0 - 192.168.1.20
(b) eth1 - 172.27.248.10
(c) lo - 127.0.0.1

All the interfaces are up and I am able to "ping" each of them successfully. But I am not able to "telnet" !!
When I try to telnet, I get the following message:

(a) [root@Bhadra root]# telnet localhost
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused

(b) [root@Bhadra root]# telnet 192.168.1.20
Trying 192.168.1.20...
telnet: connect to address 192.168.1.20: Connection refused

(c) [root@Bhadra root]# telnet 172.27.248.10
Trying 172.27.248.10...
telnet: connect to address 172.27.248.10: Connection refused


What could be the problem?
Kindly guide me to get in with telnet and get out of this problem.

Some additional information for your kind reference:
----------------------------------------------------
(a) ifconfig command:

[root@Bhadra root]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:00:E8:50:10:9A
inet addr:172.27.248.10 Bcast:172.27.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:4 dropped:0 overruns:0 carrier:8
collisions:0 txqueuelen:100
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:5 Base address:0xb800

eth1 Link encap:Ethernet HWaddr 00:08:A1:69:0B:C7
inet addr:192.168.1.20 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:906 errors:0 dropped:0 overruns:0 frame:0
TX packets:916 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:729172 (712.0 Kb) TX bytes:218019 (212.9 Kb)
Interrupt:3 Base address:0x3f00

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:8709 errors:0 dropped:0 overruns:0 frame:0
TX packets:8709 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:594126 (580.2 Kb) TX bytes:594126 (580.2 Kb)


(b) route command:
------------------
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
172.27.0.0 * 255.255.0.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth1
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default bsnl 0.0.0.0 UG 0 0 0 eth1


(c) netstat command:
--------------------

[root@Bhadra root]# netstat -nr
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
172.27.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth1


(d) chkconfig --list:
--------------------
[root@Bhadra root]# chkconfig --list
kudzu 0:off 1:off 2:off 3:on 4:off 5:on 6:off
syslog 0:off 1:off 2:on 3:on 4:off 5:on 6:off
netfs 0:off 1:off 2:off 3:on 4:off 5:on 6:off
network 0:off 1:off 2:on 3:on 4:off 5:on 6:off
random 0:off 1:off 2:on 3:on 4:off 5:on 6:off
rawdevices 0:off 1:off 2:off 3:on 4:off 5:on 6:off
pcmcia 0:off 1:off 2:on 3:on 4:off 5:on 6:off
saslauthd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
keytable 0:off 1:on 2:on 3:on 4:off 5:on 6:off
apmd 0:off 1:off 2:on 3:on 4:off 5:on 6:off
atd 0:off 1:off 2:off 3:on 4:off 5:on 6:off
gpm 0:off 1:off 2:on 3:on 4:off 5:on 6:off
autofs 0:off 1:off 2:off 3:on 4:off 5:on 6:off
iptables 0:off 1:off 2:on 3:on 4:off 5:on 6:off
irda 0:off 1:off 2:off 3:off 4:off 5:off 6:off
isdn 0:off 1:off 2:on 3:on 4:on 5:on 6:off
sshd 0:off 1:off 2:on 3:on 4:off 5:on 6:off
portmap 0:off 1:off 2:off 3:on 4:off 5:on 6:off
nfs 0:off 1:off 2:off 3:off 4:off 5:off 6:off
nfslock 0:off 1:off 2:off 3:on 4:off 5:on 6:off
sendmail 0:off 1:off 2:on 3:off 4:on 5:on 6:off
rhnsd 0:off 1:off 2:off 3:on 4:off 5:on 6:off
crond 0:off 1:off 2:on 3:on 4:off 5:on 6:off
anacron 0:off 1:off 2:on 3:on 4:off 5:on 6:off
xfs 0:off 1:off 2:on 3:on 4:off 5:on 6:off
xinetd 0:off 1:off 2:off 3:on 4:off 5:on 6:off
cups 0:off 1:off 2:on 3:on 4:off 5:on 6:off
ntpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
firstboot 0:off 1:off 2:off 3:off 4:off 5:off 6:off
arpwatch 0:off 1:off 2:off 3:off 4:off 5:off 6:off
named 0:off 1:off 2:off 3:off 4:off 5:off 6:off
httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
winbind 0:off 1:off 2:off 3:off 4:off 5:off 6:off
smb 0:off 1:off 2:off 3:off 4:off 5:off 6:off
spamassassin 0:off 1:off 2:on 3:on 4:on 5:on 6:off
canna 0:off 1:off 2:on 3:on 4:on 5:on 6:off
dhcpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
dhcrelay 0:off 1:off 2:off 3:off 4:off 5:off 6:off
FreeWnn 0:off 1:off 2:on 3:on 4:on 5:on 6:off
innd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
isicom 0:off 1:off 2:off 3:off 4:off 5:off 6:off
snmpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
snmptrapd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
hpoj 0:off 1:off 2:on 3:on 4:on 5:on 6:off
ups 0:off 1:off 2:off 3:off 4:off 5:off 6:off
mailman 0:off 1:off 2:off 3:off 4:off 5:off 6:off
psacct 0:off 1:off 2:off 3:off 4:off 5:off 6:off
lisa 0:off 1:off 2:off 3:off 4:off 5:off 6:off
xinetd based services:
chargen-udp: off
rsync: off
chargen: off
daytime-udp: off
daytime: off
echo-udp: off
echo: off
services: off
servers: off
time-udp: off
time: off
cups-lpd: off
sgi_fam: on
amanda: off
dbskkd-cdb: off
amandaidx: off
amidxtape: off
ktalk: off
swat: off
telnet: on


(e) Finally, /sbin/iptables -L command:
---------------------------------------

[root@Bhadra root]# /sbin/iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
RH-Lokkit-0-50-INPUT all -- anywhere anywhere

Chain FORWARD (policy ACCEPT)
target prot opt source destination
RH-Lokkit-0-50-INPUT all -- anywhere anywhere

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Chain RH-Lokkit-0-50-INPUT (2 references)
target prot opt source destination
ACCEPT udp -- pun3lgn-a.sancharnet.in anywhere udp spt:domain dpts:1025:65535
ACCEPT udp -- bsnl anywhere udp spt:domain dpts:1025:65535
ACCEPT tcp -- anywhere anywhere tcp dpt:ftp flags:SYN,RST,ACK/SYN
ACCEPT tcp -- anywhere anywhere tcp dpt:telnet flags:SYN,RST,ACK/SYN
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
REJECT tcp -- anywhere anywhere tcp dpts:0:1023 flags:SYN,RST,ACK/SYN reject-with icmp-port-unreachable
REJECT tcp -- anywhere anywhere tcp dpt:nfs flags:SYN,RST,ACK/SYN reject-with icmp-port-unreachable
REJECT udp -- anywhere anywhere udp dpts:0:1023 reject-with icmp-port-unreachable
REJECT udp -- anywhere anywhere udp dpt:nfs reject-with icmp-port-unreachable
REJECT tcp -- anywhere anywhere tcp dpts:x11:6009 flags:SYN,RST,ACK/SYN reject-with icmp-port-unreachable
REJECT tcp -- anywhere anywhere tcp dpt:xfs flags:SYN,RST,ACK/SYN reject-with icmp-port-unreachable


Kindly suggest and guide me to work out of this problem.
Thanks a lot.

Regards,
Sreeram
 
Old 04-01-2006, 03:06 AM   #2
rcs1000
Member
 
Registered: Feb 2004
Posts: 30

Rep: Reputation: 15
Well, firstly, is the telnet daemon running? Also, telnet may not be working, but SSH (essentially encrypted telnet) may well be.

Try:
ssh localhost

Also, try:
ps -All | grep telnet

If all three of those fail, try:
ps -All | grep sshd

If none of these work, post the replies up here!

Many thanks,

Robert
 
Old 04-01-2006, 07:17 AM   #3
sreeramabsc
LQ Newbie
 
Registered: Jan 2006
Posts: 13

Original Poster
Rep: Reputation: 0
Hello,
I am extremely thankful to you for your suggestions. Yes, SSH worked !! I could enter (login) with SSH. However, I am curious to know as to why is 'telnet' disabled? I see that 'xinetd' is running, but it is not allowing for telnet connections. Why is this? Kindly inform.

However, I have not yet achieved what I wanted to achieve. Entering the system using telnet was only the first step.

I have 2 PCs at my home. One is running Redhat 9 and other one is running Solaris 10 (for x86). I wanted to network these two. The linux box also has another interface through which I can browse the net. Now, I wanted to enter this linux box from the solaris box ( which I could do it now using SSH ). From this SSH session, I would like to open the browser (mozilla) using the command 'mozilla', but it says some display problem. I also tried to issue the command 'xterm' but even that gave the same problem.
The detailed steps and the error are as follows:

(a) I started SSH from my solaris box and logged into the linux box - Successful.
(b) I issued the command: xterm ( this means the xterm of the linux box is expected to run and I would like to see the xterm window in my solaris box ) - Failure.
**************************
ERROR MESSAGE:
Xlib: connection to "172.27.248.20:0.0" refused by server
Xlib: No protocol specified

xterm Xt error: Can't open display: 172.27.248.20:0.0
***************************
NOTE: The IP address "172.27.248.20" is that of the solaris box. In other words, I have set my display in the solaris box using the command: export DISPLAY=172.27.248.20:0.0
[I run bash shell].

(c) I also issued the command 'xhost +' in the linux box, but even this did not help.

What could be the problem here? How do I rectify it?

Kindly suggest.

Thanks,
Sreeram
 
Old 04-01-2006, 04:52 PM   #4
edcutis
Member
 
Registered: Jun 2003
Location: USA, Missouri
Distribution: mandriva , Kubuntu, MEPIS
Posts: 140

Rep: Reputation: 15
Telnet is not considered safe any more, as the user name and password are passed "in the clear" to the server. Most distributions do not include it (telnet) by default. You have to go back and specifically install and configure it. SSH is standard for most distros...

Of course, if both machines are sitting side-by-side then the man in the middle attack becomes laughable, because the man would be sitting right beside you

Have a great day!
 
Old 04-02-2006, 06:20 AM   #5
Habu
Member
 
Registered: Apr 2005
Location: Malaysia
Distribution: Fedora, Suse
Posts: 108

Rep: Reputation: 15
You'll need to enable x forwarding through ssh. When you issue the ssh command, use the -X switch.
Eg: ssh -X 172.27.248.20
 
Old 04-02-2006, 07:46 AM   #6
abhi.b
LQ Newbie
 
Registered: Apr 2006
Posts: 12

Rep: Reputation: 0
Simply do one thing.
run the following commands.

iptables -F -t filter
iptables -F -t nat
iptables -F -t mangle

Check if telnet works now or not...?
 
  


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
Can't ping localhost (ping: sendto: Operation not permitted) mentor99us Linux - Networking 7 09-05-2012 03:11 PM
Strange Ping Issue - Can't ping localhost but can ping others on LAN code_slinger Linux - Networking 13 03-17-2011 03:47 AM
MDK 9.2, Can't ping localhost but can ping outside world? JohnLocke Linux - Networking 2 07-01-2004 06:59 PM
can not telnet localhost 25 but telnet dowell.exper.dynserv.com 25 exper Linux - Software 0 02-25-2004 06:13 AM
Telnet localhost and telnet not from localhost for IMAP services seb77 Linux - Networking 1 10-15-2003 02:20 PM


All times are GMT -5. The time now is 03:15 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration