≡ Menu

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

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

Share this tutorial on:
{ 0 comments… add one }
Security: Are you a robot or human?

Leave a Comment

You can use these HTML tags and attributes: <strong> <em> <pre> <code> <a href="" title="">


   Tagged with: