FreeBSD - Tutorials, Security
Home   Archives   Sitemap   About   Contact

How to start/enable telnet on a FreeBSD server

Home NEW! Unix Forum News 100 Tips and Tricks Website Development Server Operating Systems Databases
 Ivorde.ROarrow Server Operating Systems arrowAdministration GuidesarrowHow to start/enable telnet on a FreeBSD server 

Article Sections

    Hello, Guest !
User name:
Password:
 
Google

 SSD VPS Hosting - Vpsie.com
 Mo.nitor.me
 Ivorde forum
 FreeBSD Tutorials
 Linux LVM Commands
 Free Shell Accounts
 FreeBSD Project
 FreeBSD Handbook
 Advanced Bash-Scripting Guide
 The OpenBSD Project
 Distrowatch
 FreeBSD Handbook


Apache Webserver Home Page

Posted on: 14 Mar 2008
Author: mandrei
Section: Server Operating Systems | Administration Guides
Views: 2750
Comments: 0 (Add)

How to start/enable telnet on a FreeBSD server
enable telnet on freebsd,turn on telnet on freebsd

 



In the near future I'm planing to write a "how-to" on upgrading OpenSSH and OpenSSL on a FreeBSD server. We will need, then, to enable telnet just in case upgrading ssh/ssl will fail (not that I'm planing that :D ).

How to test telnet on a FreeBSD server

$ sockstat -4l | grep -E "23|telnet"
$
$ netstat -anf inet |grep
$ telnet localhost
Trying 127.0.0.1...
^C
$

How to start/enable telnet on a FreeBSD server

As ftp daemon telnet daemon normally cannot be ran as standalone server, but by inetd. So in order to enable telnet we have to modify /etc/inetd.conf file so that telnetd will be started by inetd and to enable inetd if it already isn't enabled at startup.

$ vi /etc/inetd.conf
............................
#ssh  stream   tcp6  nowait   root  /usr/sbin/sshd    sshd -i -6
telnet   stream   tcp   nowait   root  /usr/libexec/telnetd telnetd
#telnet  stream   tcp6  nowait   root  /usr/libexec/telnetd telnetd
............................

I uncommented the line telnet   stream   tcp   nowait   root  /usr/libexec/telnetd telnetd only because I'm in only interested in telnetd on ipv4 only.

Now, enable inetd in /etc/rc.conf so that we can start inetd from it's rc script and start telnetd.

$ echo "inetd_enable="YES"" >> /etc/rc.conf
$ /etc/rc.d/inetd start
Starting inetd.
$ telnet localhost
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Trying SRA secure login:
User (root): ^C

How to check if telnet is active on a FreeBSD server

Simple 3 methods:

1. telnet to localhost

2. using FreeBSD's sockstat command:

$ sockstat -4l | grep -E "23|telnet"
root     inetd      13489 5  tcp4   *:23                  *:*

3. using netstat

$ netstat -anf inet|grep LIST|grep 23
tcp4       0      0  *.23                   *.*                    LISTEN

4. using lsof, which on FreeBSD does not come by default (Install lsof: cd /usr/ports/sysutils/lsof && make install clean)

$ lsof -nPi TCP |grep 23
inetd    13489    root    5u  IPv4 0xc23c2ae0      0t0  TCP *:23 (LISTEN)

5. using FreeBSD's fstat command

$ fstat |grep tcp | grep 23
root     inetd      13489    5* internet stream tcp c23c2ae0


Using  sockstat or lsof or fstat you can also see the daemon (inetd) and the PID (13489) of the daemon listening to port 23 TCP.

Now telnet is up and listening to port 23. Remember, I'm doing this as a temporary solution and I will redisable inetd and telnetd after ssh/ssl upgrade will be finished. Your server could have a firewall blocking port 23 from outside.

Also remember that sending passwords via telnet is very dangerous as the passwords are not being encrypted. So, if you are telneting to your server from an untrusted network you could have a surprise (the password can be sniffed). Do this only from a PC in the same LAN as the server or from some place you know it's safe.

Bookmarks: Echo "How to start/enable telnet on a FreeBSD server" around:
del.icio.usdiggFurlYahooMyWebGoogleBookmarksFaceBookTechnocratti
-------------------advertising-----------------

Other articles in Server Operating Systems / Administration Guides
» Packet Filter broken on FreeBSD 6.2 ? Unusual pf error
» Playing with GREP: grepping out lines that start with empty space
» FreeBSD: How to enable vulnerability check while installing a port?
» AIX 5.3 TL 6 and Apache 1.3 - httpd: bad user name nobody
» ProFTPd + MySQL - 530 Login incorrect




Contact webmaster regarding this article
Register or Login to post your article
Hello, Guest ! You can Login or Register to www.ivorde.ro!

 Post comment:

Name:
Title:
Comment:
Please type the word you see in the image (anti-spam verification). Refresh the page if you don't understand the word.
Allowed HTML Tags for comments:<p><strong><em><u><h1><h2><h3><h4><h5><h6><img><li>
<ol><ul><span><div><br><ins><del>

0 comment(s) to How to start/enable telnet on a FreeBSD server:

   Latest topics on the forum:
 
   Most viewed articles:
How to copy a mysql database using mysqldump - 10087 views
How to change a user's password in AIX with the output from ECHO command - 9286 views
FreeBSD: Add/remove an additional IP alias - 6453 views
Qmail relay to smarthost: How to route all mail to a smarthost - 4364 views
Change user shell on FreeBSD Linux and AIX - 3118 views

   Latest 10 articles:
Qmail relay to smarthost: How to route all mail to a smarthost - 03 Feb 2009
EXIM 4 relay to smarthost: How to route all mail except local domain - 03 Feb 2009
Windows XP: print LISTEN ports and network connections using netstat - 30 Jan 2009
How to cut out first last n characters from each file name, from a filelist - 04 Nov 2008
Mozilla Firefox3 is now released - 18 Jun 2008
How to switch lower case to upper case and upper case to lower case in a string - 17 Jun 2008
How to rename files/directories to uppercase/lowercase character names - 17 Jun 2008
How to convert lower case to upper case letters in a shell script/command - 17 Jun 2008
Unix,Linux,FreeBSD - How to rename a list of files, replacing spaces inside their names - 12 Jun 2008
How to change a user's password in AIX with the output from ECHO command - 21 May 2008


Archives
» 2007  |  June  |  October  |  November  |  December
» 2008  |  January  |  February  |  March  |  April  |  May  |  June  |  November
» 2009  |  January  |  February



Home | Archives | Sitemap | About | Contact

Designed and developed by Andrei Manescu. Optimized for Mozilla Firefox.  
Copyright 2007 Andrei Manescu
All trademarks and copyrights on this page are owned by their respective owners. Comments are owned by those who posted them.
Valid W3 Document Valid XHTML 1.0 Transitional Valid CSS! The FreeBSD Project Viewable With Any Browser