@Great-Chinese
2017-09-14T10:49:57.000000Z
字数 2330
阅读 911
Centos7新功能
1,在第一条内核条目上,按下“e”,进入edit模式,找到linux16开关的行,按“end”键到最后,输入"rd.break"
再按Ctrl+x进入系统;
mount -o remount,rw /sysroot/ # 进入后重新挂载/sysroot/,增加写的权限
chroot /sysroot/ # 切换到原始系统下
touch /.autorelabel/ # 为了selinux生效
ctrl+d # 退出单用户,然后reboot
1, 设置光驱启动
2,选择Troubleshooting
3,选择Rescure a centos system
4,选择continue
5,输入命令 chroot /mnt/sysimage
yum install -y net-tools
hostname melodylinux.com
hostnamectl set-hostname melodylinux
cat /etc/hostname
hostnamectl status
yum install -y bash-completion
source /etc/profile
hostnamectl set-hostname
service network restart
systemctl restart network.service
systemctl stop network.service
chkconfig nginx on
systemctl enable nginx.service
systemctl disable nginx.service
systemctl status network.service
systemctl list-units --type=service
/usr/lib/systemd/system/
systemctl status firewalld
systemctl list-units --type=service |grep firewalld
systemctl stop firewalld
systemctl disable firewalld
systemctl list-units --type=service |grep firewalld
yum install -y iptables-services
systemctl enable iptables.service
systemctl start iptables.service
iptables -nvL
iptables -nvL
iptables -t nat -nvL
service iptables save
service iptables restart
systemctl restart iptables.service
systemctl stop iptables
systemctl disable iptables
systemctl enable firewalld
systemctl start firewalld
firewall-cmd --get-default-zone
firewall-cmd --get-zones
work drop internal external trusted home dmz public block
firewall-cmd --get-default-zone
firewall-cmd --set-default-zone work
firewall-cmd --get-zone-of-interface=ens33
firewall-cmd --zone=public --add-interface=lo
firewall-cmd --get-zone-of-interface=lo
firewall-cmd --zone=home --change-interface=lo
firewall-cmd --zone=home --remove-interface=lo
firewall-cmd --get-active-zones
firewall-cmd --add-port=12222/tcp --permanent
firewall-cmd --reload
/etc/firewalld/zones
firewall-cmd --permanent --zone=home --add-forward-port=port=22:proto=tcp:toaddr=127.0.0.2
success
# 启动同步时间服务
cd /etc/systemd/system/multi-user.target.wants/
ll /usr/lib/systemd/system/ |grep ntp
systemctl start ntpdate.service
#查看时区命令
timedatectl status
#修改时区命令
timedatectl set-timezone Asia/Shanghai
ntpdate time.pool.aliyun.com
```