关闭TCP 25 端口对应的服务

[0 root@Qvps /root] #cat /etc/centos-release
CentOS Linux release 7.9.2009 (Core)
[0 root@Qvps /root] #uname -r
3.10.0-1160.el7.x86_64

1. 确认对应端口的进程

#ss -ntl
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 100 127.0.0.1:25 *:*
LISTEN 0 128 *:22 *:*
LISTEN 0 100 [::1]:25 [::]:*
LISTEN 0 128 [::]:22 [::]:*
#netstat -antlp | grep 25
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 695/master
tcp6 0 0 ::1:25 :::* LISTEN 695/master
[0 root@Qvps /data] #ps aux | grep 695
root 695 0.0 0.1 89708 2076 ? Ss 08:34 0:00 /usr/libexec/postfix/master -w
root 13526 0.0 0.0 112816 944 pts/0 S+ 09:26 0:00 grep --color=auto 695 # rpm -qf '/usr/libexec/postfix/master'
postfix-2.10.1-9.el7.x86_64

2. 查找与关闭对应服务

# chkconfig --list

Note: This output shows SysV services only and does not include native
systemd services. SysV configuration data might be overridden by native
systemd configuration. If you want to list systemd services use 'systemctl list-unit-files'.
To see services enabled on particular target use
'systemctl list-dependencies [target]'. netconsole 0:off 1:off 2:off 3:off 4:off 5:off 6:off
network 0:off 1:off 2:off 3:off 4:off 5:off 6:off #systemctl list-unit-files | grep post
postfix.service enabled #systemctl disable --now postfix.service
Removed symlink /etc/systemd/system/multi-user.target.wants/postfix.service.

3. 确认结果,端口已关闭

[0 root@Qvps /data] #systemctl list-unit-files | grep postfix
postfix.service disabled
[0 root@Qvps /data] #ps aux | grep postf
root 13743 0.0 0.0 112812 944 pts/0 S+ 09:29 0:00 grep --color=auto postf
[0 root@Qvps /data] #ss -ntl
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 *:22 *:*
LISTEN 0 128 [::]:22 [::]:*

最新文章

  1. iOS Debug日志 viewhierarchy调试笔记
  2. 慕课网-安卓工程师初养成-2-6 Java中的数据类型
  3. SQL高性能查询优化语句
  4. FlashPaper 使用经验之谈
  5. [DevExpress]GridControl 列头绘制Checkbox
  6. ASP.NET MVC 入门3、Routing
  7. poj1201/zoj1508/hdu1384 Intervals(差分约束)
  8. 开源的Delphi性能调试工具
  9. C#加密与解密
  10. 用maven搭建java ee项目
  11. IE浏览器右键菜单插件开发(下篇)——如何用c#安装、卸载IE右键插件
  12. 读论文系列:Object Detection CVPR2016 YOLO
  13. 深度学习之 TensorFlow(四):卷积神经网络
  14. 实例分析ASP.NET在MVC5中使用MiniProfiler监控MVC性能的方法 
  15. busybox(四)完善
  16. JGit 切换分支
  17. Jenkins服务使用nginx代理服务器做负载均衡
  18. Populate screen data automatically
  19. centos6.9NAT网络模式
  20. 洛谷P2303 [SDOi2012] Longge的问题 数论

热门文章

  1. Vue3+Vite引入Echarts5.0图表库
  2. 网络编程Netty入门:ByteBuf分析
  3. Day07_35_Colection下的方法
  4. ListBox控件的另一种数据绑定方式
  5. OAuth2(未完待续)
  6. 路由器逆向分析------Running Debian MIPS Linux in QEMU
  7. Python中math和cmath模块的使用
  8. UVA11137(立方数之和)
  9. ADB调试工具的使用
  10. node-util