Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I saw many webhosting companies are changing WHM Port and limiting it's access with the browser user-agent to be only accesses by a specific user-agent.

They are using User Agent switcher addon via Firefox and type this specific user-agent to access WHM.

How can i do this .?

share|improve this question

closed as off-topic by masegaloeh, HopelessN00b Mar 30 '15 at 14:14

  • This question does not appear to be about server, networking, or related infrastructure administration within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 0 down vote accepted

I am not 100% sure about changing the port. It might best to use port-redirection (i.e. forward to localhost:2087 and drop all packets from the outside net to ports 2086/7).

To achieve the UA protection of your WHM, I would use the string matching in IPTables Here's it in use (for a different purpose):

I would set a deny by default rule, then allow anyone who has the string with the User-Agent that you require. While IP tables will match the entire packet (i.e. it won't specifically look at the User-Agent field of the request), if you make the string specific enough, this should not be a problem.

share|improve this answer

Limiting access based on user-Agent is not reliable at all. This is simply because anyone can set the user-agent to anything. There is also a firefox addon that enables you to type whatever you want to be sent as user-agent in your requests.

share|improve this answer
While this might be true, it doesn't answer the original question. Better to explain how to achieve it and also why it's not useful in the long term, than just provide an answer saying don't do this? – EightBitTony Jun 6 '12 at 10:33
@EightBitTony: Saying don't do this will be good if the OP is asking for something unreliable or risky. – Khaled Jun 6 '12 at 10:39
@Khaled Merci, Do you have an idea for how to do it ? – Linux Intel Jun 6 '12 at 10:40
@EightBitTony Do you have an idea for how to do this ? – Linux Intel Jun 6 '12 at 10:41
I disagree - the UA protection is a nice way to prevent randomised brute-force attacks. I am assuming that the server admin will define a special (fictional) UA and only if they get a matching one, provide them with a login screen. Since this will only add a layer of security, it can't be a bad thing. – Jay Jun 11 '12 at 19:12

Not the answer you're looking for? Browse other questions tagged or ask your own question.