LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-23-2021, 09:27 PM   #1
WindsorKnot
Member
 
Registered: Aug 2005
Location: Minneapolis
Distribution: Ubuntu 14.04
Posts: 36

Rep: Reputation: 15
Need help telnetting into my Ubunto box


Hi fellas - pretty new to Linux over here; I have an ASUS Eee netbook running Ubuntu 14.04. I would like to learn a little C programming in my downtime and the devshed IDE and CodeBlocks both hurt my eyes; meanwhile the netbook's keyboardette hurts my hands. :/

So I want to configure Telnet service on the netbook so I can use the vi editor and the gcc compiler from my physically-comfier HP laptop. (Telnet's security deficiencies are a non-issue because this is a self-contained three-node network in my home; it does not connect to the Internet.)

I followed the instructions here to get the telnet service installed and running

http://jdav.is/2018/04/22/installing...-ubuntu-linux/

I have verified a successful IPv4 connection between the netbook and my Windows laptop via crossover Ethernet cable and ping test.

When I did the "ss -tnlp" command I get two sets of output under the headers State, Recv-Q , Send-Q,Local Address:Port, Peer Address:Port

LISTEN 0 128 127.0.0.1:631 *:*
users:(("cupsd",1872,11))
LISTEN 0 128 ::1:631 :::*
users:(("cupsd",1872,10))


so... confused about this. What is :631 doing there when /etc/services clearly shows telnet on port 23; Why does that second line look like maybe an IPv6 address in which case that loopback is the only IPv4 addy in the picture even though there's a healthy IPv4 link on eth0 (192.168.1.1/24).

From my Windows command line I try

telnet 192.168.1.1

and I get

Connecting To 192.168.1.1...Could not open connection to the host, on port 23: Connect failed

What else needs doing to get the telnet service up and running and connectable-to on my li'l ol Netbook?

Thanks :)
 
Old 05-23-2021, 09:56 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,681

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
Port 631 is cups i.e. the print spooler and by default only listens to localhost i.e 127.0.0.1.
It does not look like your telnet server is running. Have you checked the firewall if running to allow telnet.

Anything you can do with telnet you can do with ssh which should just work but you still might have to allow ssh traffic through the firewall.
Download PuTTy and create a shortcut on your Windows desktop.

Last edited by michaelk; 05-23-2021 at 10:40 PM.
 
1 members found this post helpful.
Old 05-23-2021, 10:26 PM   #3
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,799
Blog Entries: 1

Rep: Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066
Are *inetd and telnet.socket enabled server-side?
 
1 members found this post helpful.
Old 05-23-2021, 10:54 PM   #4
WindsorKnot
Member
 
Registered: Aug 2005
Location: Minneapolis
Distribution: Ubuntu 14.04
Posts: 36

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by michaelk View Post
Port 631 is cups i.e. the print spooler and by default only listens to localhost i.e 127.0.0.1.
It does not look like your telnet server is running. Have you checked the firewall if running to allow telnet.

Anything you can do with telnet you can do with ssh which should just work but you still might have to allow ssh traffic through the firewall.
Download PuTTy and create a shortcut on your Windows desktop.
Yeah ssh is great but these telnet roadblocks strike me as a learning opportunity!!

Quote:
Originally Posted by mrmazda View Post
Are *inetd and telnet.socket enabled server-side?
Well I googled how to check if *inetd is enabled, best I can do for you there is

Code:
root@ONCELER:~# ps aux | egrep '[xi]netd'
root      1045  0.0  0.0   2580   896 ?        Ss   20:15   0:00 /usr/sbin/xinetd -dontfork -pidfile /var/run/xinetd.pid -stayalive -inetd_compat -inetd_ipv6
root@ONCELER:~#
also tried this command, for naught :/

Code:
root@ONCELER:~# netstat -tulpn | grep LISTEN | egrep '[xi]netd'
root@ONCELER:~#
Googling "telnet.socket" seemed more of a needle in a haystack type endeavor...
 
Old 05-23-2021, 11:07 PM   #5
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,799
Blog Entries: 1

Rep: Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066
# systemctl status unit.
 
Old 05-23-2021, 11:17 PM   #6
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,726

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Code:
root@ONCELER:~# netstat -tulpn | grep LISTEN | egrep '[xi]netd'
root@ONCELER:~#
Um. netstat -tnlp Is only going to return lines containing LISTEN (try it). You’re looking to see of telnet is listening, not x/itnetd.

Generally speaking one shouldn’t filter (grep) the output of a command unless one knows what the unfiltered output is. Do things in steps.
 
Old 05-23-2021, 11:27 PM   #7
WindsorKnot
Member
 
Registered: Aug 2005
Location: Minneapolis
Distribution: Ubuntu 14.04
Posts: 36

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by mrmazda View Post
# systemctl status unit.
Aha.

Code:
root@ONCELER:~# systemctl status telnet.socket
telnet.socket
   Loaded: error (Reason: No such file or directory)
   Active: inactive (dead)

root@ONCELER:~#

So this here seems to indicate something for which the fix is... ?


(And, again, :/ )
 
Old 05-24-2021, 12:52 AM   #8
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Quote:
Originally Posted by WindsorKnot View Post
Yeah ssh is great but these telnet roadblocks strike me as a learning opportunity!
More like an exercise in frustration. Might be worth learning about systemd and conversion of init scripts. I can't believe anyone would subject themselves to this for telnet in 2021.
 
Old 05-24-2021, 02:05 AM   #9
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,799
Blog Entries: 1

Rep: Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066
Ubuntu 20.04's telnet offerings are confusing (to me at least):
Code:
# inxi -Sy
System:
  Host: host1 Kernel: 5.4.0-73-generic x86_64 bits: 64 Console: tty pts/0
  Distro: Ubuntu 20.04.2 LTS (Focal Fossa)
# aptitude search telnet | grep -v i386
p  dcap-tunnel-telnet		- Telnet tunnel for dCache
p  inetutils-telnet		- telnet client
p  inetutils-telnetd		- telnet server
p  libnet-telnet-cisco-perl	- Additional functionality to automate Cisco management
p  libnet-telnet-perl		- Perl module to script telnetable connections
p  libtelnet-dev		- Small library for parsing the TELNET protocol - development files
p  libtelnet-utils		- Small library for parsing the TELNET protocol - utilities
p  libtelnet2			- Small library for parsing the TELNET protocol - shared library
p  mactelnet-client		- Console tools for telneting and pinging via MAC addresses
p  mactelnet-server		- Telnet daemon for accepting connections via MAC addresses
p  ruby-net-telnet		- telnet client library
i  telnet			- basic telnet client
v  telnet-client		- 	
v  telnet-server		- 
p  telnet-ssl			- telnet client with SSL encryption support
i  telnetd			- basic telnet server
p  telnetd-ssl			- telnet server with SSL encryption support
# dpkg-query -l | grep telnet
ii  telnet	0.17-41.2build1	amd64	basic telnet client
ii  telnetd	0.17-41.2build1	amd64	basic telnet server
# systemctl list-unit-files | egrep 'inet|lnet'
inetd.service                          enabled
openbsd-inetd.service                  enabled
In Debian 10, from which Ubuntu derived, it's essentially the same:
Code:
# inxi -Sy
System:
  Host: host1 Kernel: 4.19.0-16-amd64 x86_64 bits: 64 Console: tty pts/0
  Distro: Debian GNU/Linux 10 (buster)
# aptitude search telnet
p   dcap-tunnel-telnet		- Telnet tunnel for dCache
p   inetutils-telnet		- telnet client
p   inetutils-telnetd		- telnet server
p   libnet-telnet-cisco-perl	- Additional functionality to automate Cisco management
p   libnet-telnet-perl		- Perl module to script telnetable connections
p   libtelnet-dev		- Small library for parsing the TELNET protocol - development fi
p   libtelnet-utils		- Small library for parsing the TELNET protocol - utilities
p   libtelnet2			- Small library for parsing the TELNET protocol - shared library
p   mactelnet-client		- Console tools for telneting and pinging via MAC addresses
p   mactelnet-server		- Telnet daemon for accepting connections via MAC addresses
p   ruby-net-telnet		- telnet client library
i   telnet			- basic telnet client
v   telnet-client		-
v   telnet-server		-
i   telnetd			- basic telnet server
# dpkg-query -l | egrep 'inet|lnet'
ii  openbsd-inetd	0.20160825-4	amd64	OpenBSD Internet Superserver
ii  telnet		0.17-41.2	amd64	basic telnet client
ii  telnetd		0.17-41.2	amd64	basic telnet server
ii  update-inetd	4.49		all	inetd configuration file updater
# systemctl list-unit-files | egrep 'inet|lnet'
inetd.service                          enabled
openbsd-inetd.service                  enabled
In openSUSE, it's vastly simpler:
Code:
# inxi -Sy
System:
  Host: host1 Kernel: 5.3.18-lp152.41-default x86_64 bits: 64
  Console: tty pts/0 Distro: openSUSE Leap 15.2
# zypper se -s telnet
...
   | perl-Net-Telnet | package | 3.04-lp152.3.2 | noarch | OSS
i+ | telnet          | package | 1.2-lp152.3.6  | x86_64 | OSS
i+ | telnet-server   | package | 1.2-lp152.3.6  | x86_64 | OSS
# systemctl list-unit-files | egrep 'inet|lnet'
telnet@.service                              static
xinetd.service                               enabled
telnet.socket                                enabled
Fedora's essentially the same as openSUSE:
Code:
# inxi -Sy
System:
  Host: host2 Kernel: 5.11.19-300.fc34.x86_64 x86_64 bits: 64
  Console: tty pts/0 Distro: Fedora release 34 (Thirty Four)
# rpm -qa | egrep 'lnet|inet'
xinetd-2.3.15-34.fc33.x86_64
telnet-server-0.17-83.fc34.x86_64
telnet-0.17-83.fc34.x86_64
# systemctl list-unit-files | egrep 'inet|lnet'
telnet@.service                            static          -
xinetd.service                             enabled
telnet.socket                              enabled
Mageia seems to be simpler still:
Code:
# inxi -Sy
System:
  Host: host3 Kernel: 5.10.19-desktop-1.mga8 x86_64 bits: 64
  Console: tty pts/0 Distro: Mageia 8 mga8
# rpm -qa | egrep 'lnet|inet'
netkit-telnet-0.17-20.mga8
xinetd-2.3.15.4-3.mga8
perl-Net-Telnet-3.40.0-8.mga8
netkit-telnet-server-0.17-20.mga8
# systemctl list-unit-files | egrep 'inet|lnet'
xinetd.service                          enabled
In all five of the above installations, telnet server is working as expected.
 
Old 05-24-2021, 05:15 AM   #10
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,681

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
No fix necessary, telnet server runs via xinetd in this case so there isn't going to be a systemd service unit nor will creating one help.

Learning xinetd might be a good experience but I don't think any distribution installs it by default anymore. Most services are standalone these days so it isn't needed.

A good teacher should instill learning good habits...

That said, it's probably not enabled to run.
 
Old 05-24-2021, 05:31 PM   #11
WindsorKnot
Member
 
Registered: Aug 2005
Location: Minneapolis
Distribution: Ubuntu 14.04
Posts: 36

Original Poster
Rep: Reputation: 15
At first I couldn't enable xinetd because I wasn't root; and damned if I could find the procedure for setting the root password on an Asus Eee. Months later that info finally appeared on the net and I was so jazzed to be able to make the configuration changes to get xinet and therefore telnet services finally running.

Then the 30,000+ post gurus here tell me setting up telnet is too difficult.

So I use ssh, it works just fine and the service had been running all along in the first place.

Sigh.

But now, on to get some C learning done.
 
Old 05-24-2021, 05:46 PM   #12
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,681

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
xinetd is not that difficult.

The point is telnet is deprecated and there is really no good valid reason to use it instead of ssh even if your network is isolated from the internet.
 
1 members found this post helpful.
Old 05-25-2021, 05:47 AM   #13
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,804

Rep: Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306
Quote:
Originally Posted by michaelk View Post
xinetd is not that difficult.

The point is telnet is deprecated and there is really no good valid reason to use it instead of ssh even if your network is isolated from the internet.
I agree, but [anyway] telnet exists and can be enabled (and disabled) - if xinetd was installed. That is documented for example here: man xinetd
 
Old 05-25-2021, 08:12 AM   #14
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Quote:
Originally Posted by WindsorKnot View Post
... gurus here tell me setting up telnet is too difficult.
Those who insist on tilting at windmills rarely accept that it is pointless.
 
Old 06-13-2021, 07:20 PM   #15
BoraxMan
Member
 
Registered: Apr 2010
Posts: 103

Rep: Reputation: 11
Do a "service xinetd restart" and run
journalctl -xe

Any errors?

I think there is an error in the instructions in that link. For my Debian 10 installation there is no /etc/inetd.conf, it is /etc/xinetd.conf

My setup is this, in /etc/xinetd.d/ I have a file called "telnet" with the following contents.

in /etc/xinetd.conf, this line is at the end

includedir /etc/xinetd.d


# default: on
# description: The telnet server serves telnet sessions; it uses \
# unencrypted username/password pairs for authentication.
service telnet
{
disable = no
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.telnetd
log_on_failure += USERID
}

Lastly, you MAY need to add to /etc/hosts.allow your internal network IP address range.

Be sure not to expose telnet to the outside world!
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
installed ubunto twice by mistake now in boot up screen get 2 options for ubunto salpapa Linux - Newbie 8 06-28-2007 05:24 PM
Problem after telnetting into HP-UX 11 daihard Other *NIX 5 05-18-2006 08:45 AM
Howto Prevent Forged Mail thru telnetting into SMTP? spurgeonb Linux - Networking 9 03-08-2004 10:45 PM
Telnetting morbo Linux - Networking 3 12-10-2001 05:16 PM
Telnetting/ftping oneself : trying to make a checklist armingaud Linux - Networking 3 06-12-2001 02:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:22 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