Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

2 Answers

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 0.0.0.0:1234 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): http://spamcleaner.org/en/misc/w00tw00t.html

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
add comment

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
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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