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 have a service running on port 1339. Is it possible to deny requests from localhost to this port? Currently I have an ufw rule to allow requests from a specified IP but localhost can access the port as well. I don't want users logged in to the server access the url with curl or wget, the port should only be accessible from the specified IP. Is this possible?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

I guess it should be possible, with something like this:

ufw deny from 127.0.0.1 to port 1339

According to ufw syntax, that's how you block an specific port on an specific ip.

share|improve this answer
    
You have a protocol parameter missing, the correct command would be ufw deny from 127.0.0.1 to any port 1339 - but still, this doesn't work. Maybe ufw doesn't affect local traffic. Anyhow, as there are no other answers, by now I'll mark this one as accepted. –  Andris Jan 31 '13 at 10:47
    
@Andris you're right about the parameter missing. Thanks for the correction. –  boris quiroz Feb 3 '13 at 15:04

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.