How to prevent Telnet to a Server from specific IP Address

Discussion in 'Linux Networking' started by jaomedes, Dec 13, 2011.

  1. jaomedes

    jaomedes New Member

    Joined:
    Dec 13, 2011
    Messages:
    1
    Likes Received:
    0
    Hello,


    How can I prevent telnet to a server from an specific IP Address?

    Thanks
     
  2. Rob

    Rob Administrator Staff Member

    Joined:
    Oct 27, 2011
    Messages:
    607
    Likes Received:
    271
    Hi, welcome to LinuxForum!

    You could use the hosts.deny file:

    telnet: 1.2.3.4

    Is this a server facing the internet though? You should be uaing ssh instead.

    Good luck,
    Rob
     
  3. ehansen

    ehansen New Member Staff Writer

    Joined:
    Jan 5, 2012
    Messages:
    115
    Likes Received:
    12
    I know this is an old-ish thread, but it is relevant to what Rob said.

    I've been noticing some distros (i.e.: Arch Linux) switching to a different system of filtering traffic and getting rid of tcp_wrappers (hosts.deny/hosts.allow) completely. So, this is something to consider as well.
     
  4. carbon333

    carbon333 New Member

    Joined:
    Feb 16, 2012
    Messages:
    87
    Likes Received:
    7
    The safest and most powerful method would be denying it using iptables.
     
  5. ehansen

    ehansen New Member Staff Writer

    Joined:
    Jan 5, 2012
    Messages:
    115
    Likes Received:
    12
    Depends. If it's an external connection then rejecting the connection at the router segment would be better and cause less overhead via iptables.
     

Share This Page