1

i to prove starting telnet with this command

sudo systemctl start telnet.socket

but i comme; Failed to start telnet.socket: Unit telnet.socket not found.

So , i am little new with Linux as i have understand , the new's Linux version ,about a prozess new to start , now to use systemd . I can start telnet with

sudo /etc/init.d/xinetd start

but i want to learn how to do this with systemd, because with it i have moreeeee possibility...

I have Debian Stretch

  • To be clear. You can systemctl start xinetd. This probably ends up being equivalent, but I would recommend training yourself to do so. Anyway, your question is how to write a custom telnet.socket (and telnet.service, I guess) which would match the behaviour you've read people talking about for systems based on RedHat, Arch Linux etc. Is that correct? – sourcejedi Mar 9 '18 at 15:05
  • "you've read people talking about for systems based on RedHat, Arch Linux etc. Is that correct? ", yes... – 567hz Mar 9 '18 at 15:06
3

You should never run a telnet server

The usual warning applies. Telnet is horribly insecure. Do not run a telnet server on your computer. Seriously, there is no good reason to do so.

Instead you can use SSH. If you were specifically interested in inetd-style socket activation, you can still do that with SSH. See /lib/systemd/system/ssh.socket and ssh@.service.

How to run a telnet server

To be clear. You can run systemctl start xinetd. Running /etc/init.d/xinet start would probably do exactly the same anyway. However, that is due to special backwards compatibility code in Debian. So I agree it is good to train yourself to use the systemd tools directly, when your system is using systemd.

Anyway, it sounds like you are interested in writing a custom telnet.socket (and telnet.service, I guess) which would match the behaviour you've read people talking about for systems based on RedHat, Arch Linux etc.

The source code for the Fedora package is currently available at https://src.fedoraproject.org/rpms/telnet/tree/master

Create the following files in /etc/systemd/system/ -

telnet.socket

[Unit]
Description=Telnet Server Activation Socket
Documentation=man:telnetd(8)

[Socket]
ListenStream=23
Accept=true

[Install]
WantedBy=sockets.target

telnet@.service

[Unit]
Description=Telnet Server
After=local-fs.target

[Service]
ExecStart=-/usr/sbin/in.telnetd
StandardInput=socket
  • " Don't run a telnet server on your computer. There is seriously no good reason to do so" , and a telnet-client ? – 567hz Mar 9 '18 at 15:17
  • telnet client used to be a common way to connect e.g. to a web server and play with the text-based protocol. this skips the telnet-specific protocol. It may also be required for interacting with devices you have, which are old, or which used telnet because they were not intended to be at all secure and they thought it was easier for them to set up a telnet server. – sourcejedi Mar 9 '18 at 15:22
  • I every time i ende to use telnet , stop it ...... – 567hz Mar 9 '18 at 15:24
  • @567hz I would still not recommend that, but it's good that you're taking such steps. – sourcejedi Mar 9 '18 at 15:50
  • What would you recommned me ? – 567hz Mar 9 '18 at 16:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.