Centos命令

来源:互联网 发布:淘宝买家真实福利图 编辑:程序博客网 时间:2024/06/05 19:18

1.查看系统版本

 lsb_release  -a

[root@iZbp118zwgdt9y0llz2lxkZ ~]# lsb_release  -aLSB Version:    :core-4.1-amd64:core-4.1-noarchDistributor ID: CentOSDescription:    CentOS Linux release 7.2.1511 (Core) Release:        7.2.1511Codename:       Core

2.防火墙相关命令

firewall-cmd --state                           ##查看防火墙状态,是否是runningfirewall-cmd --reload                          ##重新载入配置,比如添加规则之后,需要执行此命令firewall-cmd --get-zones                       ##列出支持的zonefirewall-cmd --get-services                    ##列出支持的服务,在列表中的服务是放行的firewall-cmd --query-service ftp               ##查看ftp服务是否支持,返回yes或者nofirewall-cmd --add-service=ftp                 ##临时开放ftp服务firewall-cmd --add-service=ftp --permanent     ##永久开放ftp服务firewall-cmd --remove-service=ftp --permanent  ##永久移除ftp服务firewall-cmd --add-port=80/tcp --permanent     ##永久添加80端口 iptables -L -n                                 ##查看规则,这个命令是和iptables的相同的

3.安装telnet工具

yum install xinetd telnet telnet-server -y 

4.安装ifconfig命令

yum search ifconfigyum install net-tools.x86_64

5.安装rz/sz命令

yum -y install lrzsz

6.同步服务器时间

yum search ntpdateyum install -y ntpdate.x86_64ntpdate -u ntp.api.bz
ntp.api.bz----上海授时中心

7.查看网卡信息

nmcli connection show
8.配置网络

nmcli connection modify enp0s3 \>  connection.autoconnect yes \>  ipv4.method auto
9.重启网络

service network restart


原创粉丝点击