Linux日常操作
[root] vi /etc/sysconfig/network-scripts/ifcfg-eth0
# Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)
TYPE=Ethernet #网卡类型
DEVICE=eth0 #网卡接口名称
ONBOOT=yes #系统启动时是否自动加载
BOOTPROTO=static #启用地址协议 --static:静态协议 --bootp协议 --dhcp协议
IPADDR=192.168.1.11 #网卡IP地址
NETMASK=255.255.255.0 #网卡网络地址
GATEWAY=192.168.1.1 #网卡网关地址
DNS1=10.203.104.41 #网卡DNS地址
HWADDR=00:0C:29:13:5D:74 #网卡设备MAC地址
BROADCAST=192.168.1.255 #网卡广播地址
快速设置ip
ifconfig eth0 192.168.5.40 netmask 255.255.255.0
重启Linux网络
[root] service network restart //Linux6
[root] systemctl restart network //Linux7
DNS配置文件
cat /etc/resolv.conf
host文件
cat /etc/hosts
设置主机名
cat /etc/hostname
关闭防火墙,设置开机不启动
systemctl status firewalld service
systemctl stop/start firewalld
//开机启动/不启动
systemctl disable/enable firewalld
临时/永久关闭Selinux
getenforce enforcing //查询selinux的状态
setenforce 0 //关闭selinux
vim /etc/selinux/config //查看selinux配置文件
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=enforcing
# SELINUXTYPE= can take one of three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
2、开启远程Linux界面
//使用root用户执行xhost +
[root] # xhost +
[oracle]$ DISPLAY=192.168.188.130:0.0;export DISPLAY;
浙公网安备 33010602011771号