Tomcat 8005/tcp端口安全配置

Tomcat 8005/tcp端口安全配置

在conf/server.xml 有以下内容

<Server port="8005" shutdown="SHUTDOWN">

8005是Tomcat的管理端口,默认监听在127.0.0.1上。无需验证就可发送SHUTDOWN (大小写敏感)这个字符串,Tomcat接收到后就会关闭此Server。

此管理功能建议禁用,可将SHUTDOWN改为一串猜不出的字符串实现
或者port修改成 0,会使用随机端口,如:36913
port设为-1等无效端口,将关闭此功能
此行不能被注释,否则无法启动Tomcat服务

#修改8005/tcp端口
[root@centos7 tomcat]#pwd
/usr/local/tomcat
[root@centos7 tomcat]#ss -ntl
State      Recv-Q Send-Q              Local Address:Port                             Peer Address:Port
LISTEN     0      128                             *:22                                          *:*
LISTEN     0      100                     127.0.0.1:25                                          *:*
LISTEN     0      128                          [::]:22                                       [::]:*
LISTEN     0      100                         [::1]:25                                       [::]:*
LISTEN     0      1              [::ffff:127.0.0.1]:8005                                     [::]:*
LISTEN     0      100                          [::]:8080                                     [::]:*

[root@centos7 tomcat]#vim conf/server.xml
<Server port="-1" shutdown="SHUTDOWN">

[root@centos7 tomcat]#systemctl restart tomcat.service
[root@centos7 tomcat]#ss -ntl
State      Recv-Q Send-Q              Local Address:Port                             Peer Address:Port
LISTEN     0      128                             *:22                                          *:*
LISTEN     0      100                     127.0.0.1:25                                          *:*
LISTEN     0      128                          [::]:22                                       [::]:*
LISTEN     0      100                         [::1]:25                                       [::]:*
LISTEN     0      100                          [::]:8080                                     [::]:*

猜你喜欢

转载自blog.csdn.net/weixin_51867896/article/details/124380134