Centos7.x使用相关笔记

centos7没有ifconfig怎么看ip?

ip addr  #看网卡接口和ip

ip addr add 10.8.8.2.24 dev  网卡名  #临时加ip

centos7没有netstat怎么看网络连接?

ss -ano #看网络连接状态

ss -anl #看网络监听状态

centos7怎么看某个tcp端口是什么进程开的,这个进程的pid是多少?

lsof -i:22 #看tcp22端口

centos7用systemd替换了SysV没有service了改用systemctl后怎么看当前的服务项?

systemctl list-unit-files |grep enabled  #查看当前启用的服务。

systemctl disable 服务名称   #禁止某服务

 

centos7 怎么打开http  tcp 80端口?

firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --reload

 

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

注意: 评论者允许使用'@user空格'的方式将自己的评论通知另外评论者。例如, ABC是本文的评论者之一,则使用'@ABC '(不包括单引号)将会自动将您的评论发送给ABC。使用'@all ',将会将评论发送给之前所有其它评论者。请务必注意user必须和评论者名相匹配(大小写一致)。