LinuxQuestions.org
Register a domain and help support LQ
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 03-27-2008, 06:38 AM   #1
i_nomad
Member
 
Registered: Mar 2008
Distribution: RedHatES4
Posts: 144

Rep: Reputation: 15
Unhappy Telnet problem


I am aware of the security issues but need to get it working.

#Telnet localhost gives the error

Telnet: Connection to address 127.0.0.1: connection refused
Telnet: Unaable to connect to remote host

I have Telnet installed

I try to start the service:
[root@linux]# service telnet start
telnet: unrecognized service

[root@linux]# chkconfig --list |grep telnet
> krb5-telnet: off

I have edited the file /etc/xinetd.d/telnet (there was not telnet file, so I created one and put entries in below)

# default: on
disabled = no


#/etc/rc.d/init.d/xinetd restart

After this the telnet service appears to run with description (xinetd is required for this service) and status (xinetd (pid6360 is running)

Not that it matters at this stage but there are no firewalls running.

I still cannot get telnet to work..any pointers?

Many thanks for your time
 
Old 03-27-2008, 06:57 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,523

Rep: Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502
Your /etc/xinetd.d/krb5-telnet should look like this:
Code:
# default: off
# description: The kerberized telnet server accepts normal telnet sessions, \
#              but can also use Kerberos 5 authentication.
service telnet
{
        disable = yes
        flags           = REUSE
        socket_type     = stream        
        wait            = no
        user            = root
        server          = /usr/kerberos/sbin/telnetd
        log_on_failure  += USERID
}
After editing, restart xinetd and run:
Code:
chkconfig krb5-telnet on
 
Old 03-27-2008, 07:02 AM   #3
samwise17
Member
 
Registered: Jul 2007
Location: Sydney
Distribution: Arch,Slackware,Puppy
Posts: 87

Rep: Reputation: 15
There may be an example telnet entry in /etc/xinetd.conf that's commented out, if that file exists. Here is the telnet line from my Slackware install (Slackware uses ordinary inetd, but I think they're fairly similar)

Code:
# Telnet server:
#telnet	stream  tcp     nowait  root    /usr/sbin/tcpd	in.telnetd
If you're lucky, that file will exist and a similar line will be there. Just open the file in a text editor and remove the hash '#' from the beginning of the line:
[CODE]

If not, try adding that line to the file in /etc/xinetd.d/ you already created?

EDIT: Whoops, bathory beat me to it and seems to have a much better idea of what's going on. Listen to him :-)

Last edited by samwise17; 03-27-2008 at 07:04 AM.
 
Old 03-27-2008, 07:14 AM   #4
i_nomad
Member
 
Registered: Mar 2008
Distribution: RedHatES4
Posts: 144

Original Poster
Rep: Reputation: 15
The OS is RHES 4
I have looked at krb5-telnet. The file was identical to yours.
Restarted xinetd and ran chkconfig krb5-telnet on..same problem. However on inspection of krb5-telnet it sets back the default = no from the yes set.

Regards

Last edited by i_nomad; 03-27-2008 at 07:20 AM.
 
Old 03-27-2008, 07:30 AM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,523

Rep: Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502
Running "chkconfig krb5-telnet on" should change the disable = yes to disable = no.
The line that contains "default" is just a comment to remind you that by default telnet is off.
What is the output of:
Code:
 netstat -ta|grep telnet
 
Old 03-27-2008, 07:45 AM   #6
i_nomad
Member
 
Registered: Mar 2008
Distribution: RedHatES4
Posts: 144

Original Poster
Rep: Reputation: 15
#netstat -ta|grep telnet gives no output
#service telnet status gives telnet:unrecognised service
graphical output in services shows telnet running as descibed linked to xinetd.
I did previously try removing telnet RPM and reinstalling...same problems

Regards
 
Old 03-27-2008, 08:07 AM   #7
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,523

Rep: Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502
Take a look at /var/log/messages to see if you find any errors. You can also run xinetd with the -d option (debug mode) to produce more detailed logs.
 
Old 03-27-2008, 08:52 AM   #8
i_nomad
Member
 
Registered: Mar 2008
Distribution: RedHatES4
Posts: 144

Original Poster
Rep: Reputation: 15
/var/log/messages:
Mar 27 11:38:39 mail xinetd[4472]: xinetd Version 2.3.13 started with libwrap loadavg options compiled in.
Mar 27 11:38:39 mail xinetd[4472]: Started working: 0 available services
Mar 27 11:38:58 mail xinetd[4472]: Starting reconfiguration
Mar 27 11:38:58 mail xinetd: xinetd -HUP succeeded
Mar 27 11:38:58 mail xinetd[4472]: incomplete entry [file=/etc/xinetd.d/krb5-telnet] [line=12]
Mar 27 11:38:58 mail xinetd[4472]: missing } in last service entry [file=/etc/xinetd.d/krb5-telnet] [line=12]
Mar 27 11:38:58 mail xinetd[4472]: missing service keyword [file=/etc/xinetd.d/telnetd] [line=2]
Mar 27 11:38:58 mail xinetd[4472]: missing } in last service entry [file=/etc/xinetd.d/telnetd] [line=2]
Mar 27 11:38:58 mail xinetd[4472]: Swapping defaults
Mar 27 11:38:58 mail xinetd[4472]: Reconfigured: new=0 old=0 dropped=0 (services)

xinetd -d:

08/3/27@12:51:06: DEBUG: 4597 {handle_includedir} Reading included configuration file: /etc/xinetd.d/time-udp [file=/etc/xinetd.d/time-udp] [line=17]
08/3/27@12:51:06: DEBUG: 4597 {remove_disabled_services} removing chargen
08/3/27@12:51:06: DEBUG: 4597 {remove_disabled_services} removing chargen
08/3/27@12:51:06: DEBUG: 4597 {remove_disabled_services} removing printer
08/3/27@12:51:06: DEBUG: 4597 {remove_disabled_services} removing daytime
08/3/27@12:51:06: DEBUG: 4597 {remove_disabled_services} removing daytime
08/3/27@12:51:06: DEBUG: 4597 {remove_disabled_services} removing echo
08/3/27@12:51:06: DEBUG: 4597 {remove_disabled_services} removing echo
08/3/27@12:51:06: DEBUG: 4597 {remove_disabled_services} removing eklogin
08/3/27@12:51:06: DEBUG: 4597 {remove_disabled_services} removing ftp
08/3/27@12:51:06: DEBUG: 4597 {remove_disabled_services} removing klogin
08/3/27@12:51:06: DEBUG: 4597 {remove_disabled_services} removing kshell
08/3/27@12:51:06: DEBUG: 4597 {remove_disabled_services} removing ntalk
08/3/27@12:51:06: DEBUG: 4597 {remove_disabled_services} removing rsync
08/3/27@12:51:06: DEBUG: 4597 {remove_disabled_services} removing time
08/3/27@12:51:06: DEBUG: 4597 {remove_disabled_services} removing time
Service defaults
Instances = 60
CPS = max conn:25 wait:30
Bind = All addresses.
Only from: All sites
No access: No blocked sites
Logging to syslog. Facility = authpriv, level = info
Log_on_success flags = HOST PID
Log_on_failure flags = HOST

08/3/27@12:51:06: DEBUG: 4597 {cnf_start_services} mask_max = 0, services_started = 0
08/3/27@12:51:06: CRITICAL: 4597 {init_services} no services. Exiting...
 
Old 03-27-2008, 09:11 AM   #9
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,523

Rep: Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502
You should look better at /etc/xinetd.d/krb5-telnet for errors. Perhaps you miss the last "}"
You can copy/paste the one I've posted (it's from a RH AS3 btw) to see if it works.

Regards
 
Old 03-27-2008, 09:35 AM   #10
i_nomad
Member
 
Registered: Mar 2008
Distribution: RedHatES4
Posts: 144

Original Poster
Rep: Reputation: 15
You hit the nail on the head!
The end } was missing. I am quite sure I did not touch this file..
Anyway many thanks for your time...
;-)
 
Old 03-27-2008, 09:49 AM   #11
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,523

Rep: Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502
Glad to see you've made it.

Regards
 
  


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
Unable to telnet to Linux Host inspite of installing telnet-server RPM - Need Help sinamdar Linux - Software 7 04-11-2009 08:09 AM
Can't end telnet servcie in xinetd when close remote telnet cliend forcely zeroneworld Linux - Newbie 2 12-09-2007 09:47 PM
Can't end telnet servcie in xinetd when close remote telnet cliend forcefully. zeroneworld Linux - General 1 12-06-2007 08:17 AM
Running Telnet in a script, want to save Telnet output, howtodothis??? anil3 Linux - Software 2 03-08-2006 05:01 PM


All times are GMT -5. The time now is 07:40 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration