65

How can we install a telnet client in Ubuntu 16.04? With this command, we can install a telnet server:

sudo apt-get install xinetd telnetd

But can a telnet client be installed without a telnet server? A telnet server can be dangerous.

0

3 Answers 3

133
apt-get update 
apt-get install telnet

This is a valid question BTW. Do not install the telnet server, ever. Also the telnet client is not included by default in many distros. For instance it is very common in docker-land to face the need of installing several tools that are taken otherwise for granted. For example, Official OS docker images most likely will be shipped with a shell and its built-ins. Telnet will not be shipped in any of those.

6
  • 14
    I have to apt-get update first to update the package lists.
    – f01
    Mar 6, 2017 at 3:52
  • When you say not to install it, why do you say it so forcefully? Is there a potential harm in doing so? Legitimately curious...
    – cygnus_x1
    Sep 26, 2017 at 1:09
  • 1
    @cygnus_x1 The question here is how to install the client (telnet) package. I was, in addition to responding the question, warning to not install the telnet server (xinetd telnetd) package ever just because it is not needed to use the telnet client and because its existence would make the telnet service available and invite users to connect over an unencrypted channel. Sep 27, 2017 at 19:31
  • This should be the accepted answer, otherwise the message "bash: telnet: command not found" shouldn't be showed. Feb 14, 2019 at 13:09
  • 1
    @PSatishPatro telnetd installs the server. Not recommended as I said though. Aug 15, 2019 at 8:33
37

A lot of docker images don't come with standard tools like vim, ping & telnet. You may need to install them explicitly.

sudo apt-get update && apt-get install telnet
2
  • 2
    Although the original question didn't ask about docker, this was appropriate for me. Good observation.
    – crafter
    Feb 3, 2018 at 6:52
  • This worked for me. First update and then install telnet.
    – Gagan
    Mar 19, 2021 at 3:14
6

You shouldn't need to install any packages; a telnet client should come standard with Ubuntu. Just open a terminal window (Alt + Ctrl + T) and use the telnet command (for help, type man telnet)

2
  • 14
    Not necessarily true. See the next answer, which explains how to install telnet client if it's not found. It's quite common to have a base Ubuntu with very, very little installed, especially in a containerized world. Apr 10, 2018 at 20:05
  • Not installed in most of docker containers. apt-get install telnet is valid response Jun 27, 2019 at 10:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .