Port

埠 25 不會在 Digital Ocean 液滴上打開

  • February 1, 2021

我正在嘗試設置電子郵件伺服器。我似乎無法為我打開 25 埠。我真的只是做了:

ufw disable

ufw reset

ufw default deny incoming

ufw default allow outgoing

sudo ufw allow 22/tcp

sudo ufw allow 25

sudo ufw enable

進而sudo ufw status verbose…

Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), disabled (routed)
New profiles: skip

To                         Action      From
--                         ------      ----
22/tcp                     ALLOW IN    Anywhere                  
25                         ALLOW IN    Anywhere                  
22/tcp (v6)                ALLOW IN    Anywhere (v6)             
25 (v6)                    ALLOW IN    Anywhere (v6)   

然而,粗略一瞥 sudo netstat -tulpn | grep 聽和..

tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      512/systemd-resolve 
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      664/sshd: /usr/sbin 
tcp6       0      0 :::22                   :::*                    LISTEN      664/sshd: /usr/sbin 

telnet [my server IP] 25

telnet: Unable to connect to remote host: Connection refused

是什麼賦予了?如何打開我的埠?

更新

根據這裡使用者的建議,我決定現在安裝 Postfix 並再次檢查埠是否正在被確認..

sudo netstat -tulpn | grep LISTEN
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      512/systemd-resolve 
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      664/sshd: /usr/sbin 
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      43246/master        
tcp6       0      0 :::22                   :::*                    LISTEN      664/sshd: /usr/sbin 
tcp6       0      0 :::25                   :::*                    LISTEN      43246/master     

telnet [my server IP] 25
Trying [my server IP]...
Connected to [my server IP]
Escape character is '^]'.
220 ubuntu-s-1vcpu-1gb-lon1-01 ESMTP Postfix (Ubuntu)

它似乎已連接,但這是否意味著埠已打開?

似乎您沒有偵聽埠 25 的 SMTP 伺服器。啟動您的郵件守護程序,然後重試。(另外,SMTP 從不使用 UDP,因此您可以將這些 ‘25’ 更改為 ‘25/tcp’,這將使您的防火牆更加安全。)

引用自:https://serverfault.com/questions/1051846