無法以非 root 使用者身分存取我的 tomcat 服務的高連接埠(例如 8443,8080)

無法以非 root 使用者身分存取我的 tomcat 服務的高連接埠(例如 8443,8080)

我在我的 ubuntu 伺服器 tomcat 上運行。我可以啟動服務root並可以存取我的伺服器localhost:8443tomcat

我做了什麼 :

一、我先加入用戶tomcat:

adduser tomcat ;addgroup tomcat

二.然後我將服務設定/etc/systemd/tomcat.service從 root 更改為:

[Service] 
user=tomcat 
group=tomcat

三.更改了我的 tomcat 資料夾的權限/tomcat

chown tomcat:tomcat /tomcat -R
chmod 755 /tomcat

netstate -nlp埠 8080、8443 -> 良好

iptables -L -v沒有遺失的文件 -> 好

service started作為 tomcat -> 好

但我仍然無法連接到伺服器。如果我將user,更改group為 tomcat.service 的根目錄,我將到達伺服器。

我不知道問題出在哪裡。

如果有專家可以幫助我,我將不勝感激。

親切的問候

鬍鬚黑

相關內容