关闭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 [::]:*

Linux(CentOS 7) 安全加固之非业务端口服务关闭 postfix port 25的更多相关文章

  1. Linux(CentOS)系统下安装好apache(httpd)服务后,其他电脑无法访问的原因

    原文:Linux(CentOS)系统下安装好apache(httpd)服务后,其他电脑无法访问的原因 今天试了下在虚拟机上利用CentOS系统的yum命令安装好了httpd(apache2.4.6), ...

  2. Linux Centos 6.9中SSH默认端口修改的坑

    关于Linux Centos6.5的SSH默认端口修改的博客有一大堆,我在这里就不啰嗦了,但是面对Centos 6.9,就会发现有一个巨坑: 修改iptables之后执行下面的命令后: # servi ...

  3. linux(centos 6.4)下安装php memcache服务端及其客户端(详细教程)

    前言 在搭建个人博客时,由于没有使用任何框架,纯手工code前台和后台,导致遇到许多问题,其中一个问题就是mysql连接导致的页面相应速度异常低.在查询各种途径后,只能考虑使用memcache缓存.在 ...

  4. 阿里云服务器Linux CentOS安装配置(六)resin多端口配置、安装、部署

    阿里云服务器Linux CentOS安装配置(六)resin多端口配置.安装.部署 1.下载resin包 http://125.39.66.162/files/2183000003E08525/cau ...

  5. 在CentOS Linux系统上,添加新的端口,启用ssh服务

    SSH作为Linux远程连接重要的方式,如何配置安装linux系统的SSH服务,如何开启SSH? SSH是什么? SSH 为 Secure Shell 由 IETF 的网络工作小组(Network W ...

  6. 在 CentOS 7.3 上安装 nginx 服务为例,说明在 Linux 实例中如何检查 TCP 80 端口是否正常工作

    CentOS 7.3 这部分以在 CentOS 7.3 上安装 nginx 服务为例,说明在 Linux 实例中如何检查 TCP 80 端口是否正常工作. 登录 ECS 管理控制台,确认实例所在安全组 ...

  7. Linux常用的安全加固

    一.账号和口令 1.1 禁用或删除无用账号 减少系统无用账号,降低安全风险. 操作步骤userdel <用户名> //删除不必要的账号.passwd -l <用户名> //锁定 ...

  8. Linux CentOS 配置Tomcat环境

    一.下载Tomcat 下载Tomcat方式也有两种,可以参考我的前一篇博文Linux CentOS配置JDK环境,这边就不再赘述. 二.在Linux处理Tomcat包 1.创建tomcat文件夹 mk ...

  9. NoSql1 在Linux(CentOS)上安装memcached及使用

    前言:       今天是初五,生活基本要从过年的节奏中回归到正常的生活了,所以想想也该想想与工作有关的事情了.我之前在工作中会经常使用memcached和redis,但是自己一直没有时间系统的好好看 ...

随机推荐

  1. VirtualBox虚拟机读取U盘

    1 概述 使用VirtualBox虚拟机(系统Win10)读取宿主机(系统Manjaro)中的U盘. 2 安装扩展 戳这里下载对应版本的一个叫Oracle_VM_VirtualBox_Extensio ...

  2. Vue Hello World

    1 Vue介绍 伟大的项目是从Hello World而来的,Hello World尽管没有什么实际性的作用,但是在于意义重大.(哈哈哈哈) 好了不废话了入正题. Vue是一套用于构建用户界面的渐进式J ...

  3. Day03_16_递归

    Java递归 递归包含两个部分 递归头: 标明了什么时候结束递归调用,如果没有递归头,程序将陷入死循环. 递归体: 标明了什么时候需要继续调用自身. 实例 import java.util.Scann ...

  4. Azure CDN 为静态网站创建内容分发网络

    一,引言 最近刚刚接触 Edi.Wang 的 Moonglade 博客系统,正好这套系统中有使用到 Azure CND (内容分发网络),那就学习学习.那么今天就尝试利用 Azure CDN 来发布静 ...

  5. 老学长的TODOLIST

    初期: 一.基本算法: (1)枚举(poj1753,poj2965) (2)贪心(poj1328,poj2109,poj2586) (3)递归和分治法 (4)递推 (5)构造法(poj3295)(这种 ...

  6. RF-日期时间拼接(20191024_195355)

    *** Test Cases *** testGetTime @{time}= Get Time year month day hour min sec ${sDate}= Catenate SEPA ...

  7. 死磕到底RecyclerView | RecyclerView 的滚动是怎么实现的?

    RecyclerView 是一个展示列表的控件,其中的子控件可以被滚动.这是怎么实现的?以走查源码的方式一探究竟. 切入点:滚动事件 阅读源码时,如何在浩瀚的源码中选择合适的切入点很重要,选好了能少走 ...

  8. 码农飞升记-03-OpenJDK是什么?

    目录 1.OpenJDK 概述 2.OpenJDK 的发展史 3.OpenJDK Community 1.角色定义 Participant(参与者) Contributor(贡献者) OpenJDK ...

  9. 数据表格 layui.table

    layui官网-表单 自动渲染 方法渲染 table.render,cols中的field是后台传递的data map.put("data",stuService.selectSt ...

  10. spring中注解@Resource 与@Autowire 区别

    ① .@Resource 是根据名字进行自动装配:@Autowire是通过类型进行装配. ②. @Resource 注解是 jdk 的:@Autowire 是spring的.