[01] 顶部横幅广告(左侧)
推荐尺寸:728×90
全站顶部通栏
请在主题选项中添加广告代码或上传图片
[02] 顶部横幅广告(右侧)
推荐尺寸:340×90
全站顶部通栏
请在主题选项中添加广告代码或上传图片

Centos 常用的命令

文章目录

firewalld防火墙

查看防火墙状态

systemctl status firewalld.service

或者

firewall-cmd --state

关闭运行的防火墙

systemctl stop firewalld.service

永久关闭防火墙禁止防火墙服务

systemctl disable firewalld.service

iptables

安装 iptables service

yum -y install iptables-services

设置防火墙开机启动

systemctl enable iptables.service

重启防火墙使配置生效

systemctl restart iptables.service

清除iptables防火墙规则

iptables -F

检查iptables防火墙状态

service iptables status

开启转发功能

echo -e "net.ipv4.ip_forward=1" >> /etc/sysctl.conf sysctl -p

安装 screen

新建窗口运行程序

yum install screen

update centos系统

yum -y update

查看centos系统的版本

cat /etc/redhat-release

查看centos内核版本

uname -a

查看系统时间

date

更改系统时间时区

timedatectl set-timezone Asia/Shanghai

更换源

yum install epel-release

获取外网IP

curl icanhazip.com
curl cip.cc #带归属地
curl ip.sb
curl ipinfo.io #带归属地

获取网卡IP

ip addr show

安装进程查看工具

yum install net-tools -y

查看进程信息

netstat -lntup
欧美亚VPS推荐网 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:Centos 常用的命令