System Settings
MAC OS Connect Warning
ssh USER@HOST
# -bash: warning: setlocale:
# LC_CTYPE: cannot change locale (UTF-8): No such file or directory
locale
# LANG=en_US.UTF-8
# LC_CTYPE=UTF-8
# These two options are different, they should be same.
vim /etc/locale.conf
# LANG="en_US.UTF-8"
# append: LC_CTYPE="en_US.UTF-8"
exitModify the name of the network card to " eth0 "
cd /etc/sysconfig/network-scripts/
mv ifcfg-ens33 ifcfg-eth0
vim ifcfg-eth0
# modify: NAME=eth0
# modify: DEVICE=eth0vim /etc/default/grub
# GRUB_CMDLINE_LINUX append: biosdevname=0 net.ifnames=0grub2-mkconfig -o /boot/grub2/grub.cfgsystemctl rebootHostname setting
CentOS 6
vim /etc/sysconfig/network
# HOSTNAME=<HOSTNAME>vim /etc/hosts
# hosts文件中添加:127.0.0.1 <HOSTNAME>hostname <HOSTNAME>exec bashCentOS 7
hostnamectl set-hostname <HOSTNAME>vim /etc/hosts
# hosts文件中添加:127.0.0.1 <HOSTNAME>exec bashSystem Time setting
date -s "2000/11/1 00:00:00"clock -w
# Set the Hardware Clock to the current System Time.Filesystem mount or unmount
Mount a filesystem
mount /dev/cdrom /mntUnmount a filesystem
umount /mntConfig system startup auto mount
vim /etc/fstabSELinux setting
View SELinux state
getenforceOpen SELinux temporarily
setenforce 1Close SELinux temporarily
setenforce 0Set SELinux state permanently
vim /etc/selinux/configFirewall setting
CentOS 6 - iptables
service iptables statusservice iptables start
service iptables stop
service iptables restart/etc/init.d/iptables start
/etc/init.d/iptables stop
/etc/init.d/iptables restartchkconfig iptables on
chkconfig iptables offCentOS 7 - firewalld
systemctl status firewalld.servicesystemctl start firewalld.service
systemctl stop firewalld.service
systemctl restart firewalld.servicesystemctl enable firewalld.service
systemctl disable firewalld.serviceLast updated