{"id":12800,"date":"2021-12-16T08:12:27","date_gmt":"2021-12-16T08:12:27","guid":{"rendered":"https:\/\/linuxways.net\/?p=12800"},"modified":"2021-12-16T08:12:27","modified_gmt":"2021-12-16T08:12:27","slug":"how-to-install-telnet-server-and-client-on-ubuntu","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/ubuntu\/how-to-install-telnet-server-and-client-on-ubuntu\/","title":{"rendered":"How to Install Telnet Server and Client on Ubuntu"},"content":{"rendered":"<p>Telnet is a network protocol used for connecting to remote systems through a command-line interface. It can be used to configure remote devices such as routers, switches, servers, etc. Telnet can also be used to test if a TCP port on a remote system is open or not.<\/p>\n<p>In today&#8217;s guide, we will install the Telnet server and client on Ubuntu. We will be using the two Ubuntu 20.04 LTS machines. On one Ubuntu machine, we will install Telnet server. On another Ubuntu machine, we will install the Telnet client. Then we will connect to the Telnet server using the Telnet client.<\/p>\n<p><strong>Note: <\/strong>Telnet is not a secure protocol because the Telnet session between server and client is unencrypted. You can use it for testing the connectivity to TCP ports. However, for connecting to the remote system, it is recommended to use SSH.<\/p>\n<h2>Installing Telnet Server on Ubuntu<\/h2>\n<p>Ubuntu default repository contains the Telnet server package. Therefore, it can be simply installed with the apt command. On one Ubuntu machine, install Telnet server by running the command below in the Terminal:<\/p>\n<pre>$ sudo apt install telnetd xinetd<\/pre>\n<p>After running the above installation command, Terminal might prompt you with the<strong> y\/n<\/strong> option. To continue the procedure, hit <strong>y <\/strong>and then hit<strong> Enter.<\/strong> It will then install the Telnet server and xinetd on your Ubuntu system.<\/p>\n<p>After installation, the xinetd service starts automatically. You can view the status of the service as follows:<\/p>\n<pre>$ sudo systemctl status xinetd.service<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"776\" height=\"136\" class=\"wp-image-12801\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-109.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-109.png 776w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-109-300x53.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-109-768x135.png 768w\" sizes=\"auto, (max-width: 776px) 100vw, 776px\" \/><\/p>\n<p>If the service does not start automatically, you can manually start it by running the command below:<\/p>\n<pre>$ sudo systemctl start xinetd.service<\/pre>\n<p>Now create the <strong>\/etc\/xinetd.d\/telnet<\/strong> file using the command below:<\/p>\n<pre>$ sudo nano \/etc\/xinetd.d\/telnet<\/pre>\n<p>Add the below lines the file:<\/p>\n<pre>service telnet\r\n\r\n{\r\n\r\ndisable = no\r\n\r\nflags = REUSE\r\n\r\nsocket_type = stream\r\n\r\nwait = no\r\n\r\nuser = root\r\n\r\nserver = \/usr\/sbin\/in.telnetd\r\n\r\nlog_on_failure += USERID\r\n\r\n}<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"542\" height=\"246\" class=\"wp-image-12802\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-110.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-110.png 542w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-110-300x136.png 300w\" sizes=\"auto, (max-width: 542px) 100vw, 542px\" \/><br \/>\nThen save and close the file and restart xinetd.service as follows:<\/p>\n<pre>$ sudo systemctl restart xinetd.service<\/pre>\n<p>Telnet server uses port 23 for listening to the incoming connections. Therefore, you will need to open this port in your firewall. Run the command below to do so :<\/p>\n<pre>$ sudo ufw allow 23<\/pre>\n<p>To allow incoming connections to port 23 from only a specific IP or subnet, run the below command instead:<\/p>\n<pre>$ sudo ufw allow from &lt;ip or subnet&gt; to any port 23<\/pre>\n<h2>Installing Telnet Client on Ubuntu<\/h2>\n<p>Telnet client is also available in the Ubuntu repository. On your second Ubuntu machine, run the command below in Terminal to install the Telnet client.<\/p>\n<pre>$ sudo apt install telnet<\/pre>\n<p>After running the above installation command, Terminal might prompt you with the<strong> y\/n<\/strong> option. To continue the procedure, hit <strong>y <\/strong>and then hit<strong> Enter.<\/strong> It will then install the Telnet client on your Ubuntu system.<\/p>\n<h2>Connect to Telnet Server from Remote System<\/h2>\n<p>Now you can connect to your Telnet server from another machine (where the Telnet client is installed). On your client machine, use the following command syntax to connect to the Telnet server:<\/p>\n<pre>$ telnet &lt;server-ip&gt;<\/pre>\n<p>Where &lt;server-ip&gt; is the IP address of the Telnet server.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"806\" height=\"534\" class=\"wp-image-12803\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-111.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-111.png 806w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-111-300x199.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-111-768x509.png 768w\" sizes=\"auto, (max-width: 806px) 100vw, 806px\" \/><\/p>\n<h2>Uninstall Telnet Server and Client<\/h2>\n<p>If for any reason you want to uninstall Telnet server and client from your Ubuntu machine, you can do so as described below.<\/p>\n<p>To uninstall Telnet server, run this command:<\/p>\n<pre>$ sudo apt remove telnetd xinetd<\/pre>\n<p>To uninstall Telnet client, run this command:<\/p>\n<pre>$ sudo apt remove telnet<\/pre>\n<p>After running the above commands, Terminal might prompt you with the<strong> y\/n<\/strong> option. To continue the procedure, hit <strong>y <\/strong>and then hit<strong> Enter.<\/strong> It will then remove the applications from your Ubuntu system.<\/p>\n<p>By following the method explained above, you can easily install the Telnet server and client on your Ubuntu systems. We have also shared the method to uninstall the Telnet server and client from Ubuntu in case you need to remove it.<\/p>","protected":false},"excerpt":{"rendered":"<p>Telnet is a network protocol used for connecting to remote systems through a command-line interface. It can be used to configure remote devices such as routers, switches, servers,&hellip;<\/p>","protected":false},"author":1,"featured_media":13017,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[746,100],"class_list":["post-12800","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ubuntu","tag-telnet","tag-ubuntu-20-04"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/12800","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=12800"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/12800\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/13017"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=12800"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=12800"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=12800"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}