码迷,mamicode.com
首页 > 其他好文 > 详细

Centos优化端口显示

时间:2017-10-18 16:10:37      阅读:159      评论:0      收藏:0      [点我收藏+]

标签:serve   ping   div   root   netstat   for   add   tar   foreign   

Centos-7

[root@linux-node1 ~]# cat /etc/redhat-release 
CentOS Linux release 7.4.1708 (Core) 
[root@linux-node1 ~]# netstat -ntpl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1086/sshd           
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1280/master         
tcp6       0      0 :::22                   :::*                    LISTEN      1086/sshd           
tcp6       0      0 ::1:25                  :::*                    LISTEN      1280/master         
[root@linux-node1 ~]# systemctl stop postfix.service 
[root@linux-node1 ~]# systemctl enable postfix.service 
[root@linux-node1 ~]# sed -i s/#ListenAddress 0.0.0.0/ListenAddress 0.0.0.0/g /etc/ssh/sshd_config 
[root@linux-node1 ~]# systemctl restart sshd
[root@linux-node1 ~]# netstat -ntpl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1524/sshd

Centos-6

[root@localhost ~]# cat /etc/redhat-release 
CentOS release 6.8 (Final)
[root@localhost ~]# netstat -ntpl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name   
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      1329/sshd           
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      1408/master         
tcp        0      0 :::22                       :::*                        LISTEN      1329/sshd           
tcp        0      0 ::1:25                      :::*                        LISTEN      1408/master         
[root@localhost ~]# /etc/init.d/postfix stop
Shutting down postfix:                                     [  OK  ]
[root@localhost ~]# chkconfig postfix off
[root@localhost ~]# sed -i s/#ListenAddress 0.0.0.0/ListenAddress 0.0.0.0/g /etc/ssh/sshd_config
[root@localhost ~]# service sshd restart
Stopping sshd:                                             [  OK  ]
Starting sshd:                                             [  OK  ]
[root@localhost ~]# netstat -ntpl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name   
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      1540/sshd

 

Centos优化端口显示

标签:serve   ping   div   root   netstat   for   add   tar   foreign   

原文地址:http://www.cnblogs.com/syaving/p/7686958.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!