Limit the number of Telnet sessions coming from the same remote system

by on January 5, 2007 · 0 comments· LAST UPDATED January 5, 2007

in , ,

Q. How do I configure telnet server so that I can limit the number of Telnet sessions coming from the same remote system under Cent OS Linux?

A. You can use iptables to limit the number of Telnet sessions coming from the same remote system. However iptables may take some time. CentOS (and Redhat Linux, Fedora Core) use xinetd to manage telnet server. You need to set per_source variable.

The per_source config directive can define the limit for Telnet sessions coming from the same remote system.

Open /etc/xinetd.d/telnet file
# vi /etc/xinetd.d/telnet
Append/modify per_source as follows:
per_source = 2

Save and close the file. At the end your file should read as follows:
service telnet

{
        disable = no
        flags           = REUSE
        socket_type     = stream
        wait            = no
        user            = root
        server          = /usr/sbin/in.telnetd
        log_on_failure  += USERID
        per_source      = 2
}

Restart xinetd service:
# /etc/init.d/xinetd restart

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 0 comments… add one now }

Leave a Comment

Tagged as:

Previous Faq:

Next Faq: