LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-04-2015, 06:46 PM   #1
8bit
LQ Newbie
 
Registered: Jul 2015
Posts: 8

Rep: Reputation: Disabled
hosts.allow


Hi, First of all this is my first post on this forum

Anyways I have created a java tcp socket server that listens on a certain port, I am able to connect to its ip : port via my client hosted on a website, lately this guy has been making it harder for me to test my client more and more because he was able to decompile my client and find out what port my server is running on and than he made his own modified client that can spam my tcp server, I am trying to figure out a way that my tcp server will only listen to the client on my website, NO OTHER CLIENT only the one on my site, And it has come to my understanding that in the /etc/hosts.allow file can do this, but i tried many methods using it starting with ALL: because my java server isnt run as a daemon and i dont know what to specify it as, also if anyone has a better approach please let me know.

PHP Code:
Thanks 

Last edited by 8bit; 07-04-2015 at 06:48 PM.
 
Old 07-05-2015, 01:26 AM   #2
mralk3
Slackware Contributor
 
Registered: May 2015
Distribution: Slackware
Posts: 1,900

Rep: Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050
hosts.allow

Use your firewall. Block all ip addresses you do not want to connect to your server on the specified port that your java app listens to.
 
Old 07-06-2015, 05:54 AM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,355

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
You can only use hosts.allow if your code uses tcp wrappers http://www.linuxtopia.org/online_boo...-wrappers.html aka libwrap or run through the xinetd daemon.

As above, if your client has a know fixed IP, you can use iptables (firewall system) to allow by exception.
 
Old 07-07-2015, 05:09 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,973

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
Just thinking to myself.

Go wild maybe and rotate ports. After sync to program use a scheme to rotate ports.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
/etc/hosts.deny not blocking hosts from using NFS - Centos m223464 Linux - Security 3 05-10-2012 08:54 PM
Access denied for NFS - but hosts.allow and hosts.deny seem OK royce2020 Linux - Networking 4 10-17-2011 10:44 PM
Script for hosts, numbers of hosts and users connected to squid server arunabh_biswas Programming 5 08-28-2010 04:11 AM
Verify /etc/hosts usage and round robin in /etc/hosts MikeyCarter Linux - Software 1 06-24-2008 12:20 PM
can't restrict sshd access through hosts.allow and hosts.deny but was working earlier farhan Linux - Security 4 04-18-2008 07:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration