LEAP 15 : How to install Telnet server?

Really straightforward back in 42.x, can’t seem to find the option here now. I can obviously install the telnet and telnet-server package but I can’t find a way to enable the service. tftp and ftp were pretty straightforward, it’s in the list of system services that I can enable/disable start/stop.

Yes I know it is insecure, there’s no need for a lecture here. This is a cordoned off lab for test purposes that is not connected to the outside world and we need to be compatible with legacy test software that relies on Telnet access.

Is this going to be possible at all?

systemctl enable telnet.socket
systemctl start telnet.socket

Where from or how did you install telnet-server?

The standard openSUSE package comes with a telnet.socket and a telnet@.service.
I.e. it should be started automatically by telnet.socket if something tries to access port 23.
Or you should be able to start it explicitly via:

systemctl start telnet@.service

(replace “start” with “enable” to start it automatically on boot)

No idea if that works though, I never used it.

Actually I find it strange somehow that the service is called telnet@ (which is actually a service template), as it doesn’t evaluate any parameters…

PS: as arvidjaar wrote at the same time, you may just have to enable the telnet.socket, it’s probably not active by default.

Oh, and you’d likely have to open the corresponding port (23) in the firewall too it it’s installed/active.

Leap 15.0 uses firewalld by default instead of the old SuSEfirewall, but upgrades will keep using the latter to avoid “surprises”.
The way to configure them differs (and the YaST module has been dropped), so please tell whether it’s an upgrade or new install if you need help with that.

Or, to be more precise, please provide the output of these commands:

systemctl status SuSEfirewall2
systemctl status firewalld

Yes, thanks, that did the trick.
I don’t have to worry about firewall, it’s completely disabled. If this system were connected to the outside world, I’d be in serious trouble! :slight_smile:

By the way, how come it doesn’t show up in the Services Manager like most of the other things? It still doesn’t even though it has been enabled and started from the command line.

It’s socket activated. Check

# systemctl status telnet.socket

You should get something like…


● telnet.socket - Telnet Server Activation Socket
   Loaded: loaded (/usr/lib/systemd/system/telnet.socket; disabled; vendor preset: disabled)
   Active: active (listening) since Thu 2018-06-28 12:38:59 NZST; 1min 27s ago
     Docs: man:telnetd(8)
   Listen: ::]:23 (Stream)
 Accepted: 0; Connected: 0

In another terminal window on same host you can test with

telnet localhost

Now you should get

# systemctl status telnet.socket
● telnet.socket - Telnet Server Activation Socket
   Loaded: loaded (/usr/lib/systemd/system/telnet.socket; disabled; vendor preset: disabled)
   Active: active (listening) since Thu 2018-06-28 12:38:59 NZST; 1min 27s ago
     Docs: man:telnetd(8)
   Listen: ::]:23 (Stream)
 Accepted: 1; Connected: 1

and the daemon will be started…

# ps -A|grep telnet
11909 pts/1    00:00:00 telnet
11916 ?        00:00:00 in.telnetd

No, you should not. It is impossible to start template.

Yes, that won’t work as the service is defined.

Hi, I am new to Leap 15.2 - previously running Leap 4.2 (where life seemed much simpler)

This thread has helped me start telnetd but …

I cannot connect to my host from any other machine. Running a netstat -l I see the following entry:

tcp6 0 0 ::]:telnet ::]:*

This looks wrong. I don’t understand why the listener appears to be using IPv6

telnet localhost works fine but a client on any other host fails.

Appreciate any suggestions.

The output of netstat doesn’t mean telnet is not listening on IPv4 address. It is a IPv4-mapped IPv6 address. Examining /usr/lib/systemd/system/telnet.socket, you’ll note that the listen directive is

ListenStream=23

From ‘man systemd.socket’…

If the address string is a single number, it is read as port number to listen on via IPv6. Depending on the value of BindIPv6Only= (see below) this might result in the service being available
via both IPv6 and IPv4 (default) or just via IPv6.

For reference, I have

# cat /proc/sys/net/ipv6/bindv6only
0

This means IPv4-mapped address feature is enabled.

You mention that you can’t access telnet remotely? Not a firewall configuration preventing access to this service?

Brilliant! Firewall was the issue here.

I guess I misdirected my attention after looking at the output of netstat and not understanding that it is a IPv4-mapped IPv6 address - I’ll need to brush up my knowledge of what is going on here. Seems like there have been many changes Leap 4.2 -> 15.2 - any pointers to helpful docs I can study (I’m ex kernel developer ICL, Sun, Unixware, SCO & HP-UX so a bit out of touch) ?

Moving on now to my next problem trying to get Samba running !

Many thanks.

Maybe Leap 42.x?

Indeed (apologies for the typo)

Glad to have been of guidance. I’m sure that your professional background and experience will be of benefit to us here at openSUSE Forums. :wink: