设置不锁屏:
applications->system tools->settings->privacy->Screen Lock
按钮打到off即可。
查看内核版本:
uname -a
查看发行版本:
cat /etc/*elease
设置静态IP:
cd /etc/sysconfig/network-scripts
看到类似这样的一个文件 ifcfg-eno16777736
vim ifcfg-eno16777736
修改如下:
BOOTPROTO改为static
IPADDR=192.168.40.15
NETMASK=255.255.255.0
GATEWAY=192.168.40.1
DNS1=111.222.3.4
ONBOOT=yes
最终效果:
HWADDR=00:0C:29:0F:85:0F
TYPE=Ethernet
BOOTPROTO=static
IPADDR=192.168.40.15
NETMASK=255.255.255.0
GATEWAY=192.168.40.1
DNS1=111.222.3.4
NM_CONTROLLED=no
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=eno16777736
UUID=3e1c3d6a-866e-4498-9c50-eb644608e5d5
ONBOOT=yes
重启网络:
systemctl restart network.service
如果不行可以试试 service network restart,
注意如果是虚拟机的话要把网络设置为桥接模式
参考这里centos7设置静态IP
关闭防火墙:
service firewalld status #查看状态
service firewalld start
service firewalld stop
systemctl disable firewalld #永久禁止
参考这里centos7 关闭防火墙
清除缓存:
To free pagecache:
echo 1 > /proc/sys/vm/drop_caches
To free dentries and inodes:
echo 2 > /proc/sys/vm/drop_caches
To free pagecache, dentries and inodes:
echo 3 > /proc/sys/vm/drop_caches
设置ulimit:
vim /etc/sysctl.conf
fs.file-max = 100000
vim /etc/security/limits.conf
* soft nproc 65535
* hard nproc 65535
* soft nofile 65535
* hard nofile 65535
sudo sysctl -p
查看端口情况:
netstat -ntlp