2017-03-12 12 views
13

मैं अपने मैक के पोर्ट 25 खोलना चाहते खोलते हैं, तो मैं फ़ाइल /etc/pf.confमैक OSX - एक बंदरगाह

MacBook-Pro-de-nunito:~ calzada$ more /etc/pf.conf 
# 
# Default PF configuration file. 
# 
# This file contains the main ruleset, which gets automatically loaded 
# at startup. PF will not be automatically enabled, however. Instead, 
# each component which utilizes PF is responsible for enabling and disabling 
# PF via -E and -X as documented in pfctl(8). That will ensure that PF 
# is disabled only when the last enable reference is released. 
# 
# Care must be taken to ensure that the main ruleset does not get flushed, 
# as the nested anchors rely on the anchor point defined here. In addition, 
# to the anchors loaded by this file, some system services would dynamically 
# insert anchors into the main ruleset. These anchors will be added only when 
# the system service is used and would removed on termination of the service. 
# 
# See pf.conf(5) for syntax. 
# 

# 
# com.apple anchor point 
# 
pass in proto tcp from any to any port 80 
pass in proto tcp from any to any port 25 
scrub-anchor "com.apple/*" 
nat-anchor "com.apple/*" 
rdr-anchor "com.apple/*" 
dummynet-anchor "com.apple/*" 
anchor "com.apple/*" 
load anchor "com.apple" from "/etc/pf.anchors/com.apple" 

संपादित लेकिन जब मैं सेवा को पुनः आरंभ, मैं इन त्रुटियों को मिल गया:

MacBook-Pro-de-nunito:~ calzada$ sudo pfctl -f /etc/pf.conf 
pfctl: Use of -f option, could result in flushing of rules 
present in the main ruleset added by the system at startup. 
See /etc/pf.conf for further details. 

No ALTQ support in kernel 
ALTQ related functions disabled 
/etc/pf.conf:24: Rules must be in order: options, normalization, queueing, translation, filtering 
/etc/pf.conf:25: Rules must be in order: options, normalization, queueing, translation, filtering 
/etc/pf.conf:26: Rules must be in order: options, normalization, queueing, translation, filtering 
pfctl: Syntax error in config file: pf rules not loaded 

फ़ाइल के अंत में लाइनों को जोड़ने:

MacBook-Pro-de-nunito:~ calzada$ sudo pfctl -f /etc/pf.conf 
pfctl: Use of -f option, could result in flushing of rules 
present in the main ruleset added by the system at startup. 
See /etc/pf.conf for further details. 

No ALTQ support in kernel 
ALTQ related functions disabled 
MacBook-Pro-de-nunito:~ calzada$ nmap -p 25 localhost 

Starting Nmap 7.40 (https://nmap.org) at 2017-03-12 21:35 CET 
Nmap scan report for localhost (127.0.0.1) 
Host is up (0.00023s latency). 
Other addresses for localhost (not scanned): ::1 
PORT STATE SERVICE 
25/tcp closed smtp 

Nmap done: 1 IP address (1 host up) scanned in 0.04 seconds 
+0

सुन रहा है की जाँच करने के लिए निम्न का उपयोग कर सकते * pf.conf फ़ाइल के नीचे * करने के लिए अपने नए "' in' पारित "लाइनों जाकर देखें। मैंने जो भी उदाहरण देखा है, वे अंत में हैं। –

+2

इस तरह के एक संक्षिप्त पोस्ट शीर्षक! – Eduard

उत्तर

6

क्या आप वाकई कुछ पोर्ट 25 पर सुन है कर रहे हैं? अगर आपके पास पोर्ट 25 पर कुछ भी नहीं है तो यह बंद के रूप में दिखाएगा।

जैसे ही आप स्थानीयहोस्ट पर nmap चलाते हैं तो आपको फ़ायरवॉल के माध्यम से कुछ भी अनुमति देने की आवश्यकता नहीं होगी। यदि किसी अन्य डिवाइस से ट्रैफ़िक आ रहा है तो आपको केवल फ़ायरवॉल के माध्यम से इसे अनुमति देने की आवश्यकता होगी।

आप अगर एक कार्यक्रम पोर्ट 25 पर

lsof -n -i:25 | grep LISTEN

संबंधित मुद्दे