@Great-Chinese
2017-09-14T02:49:57.000000Z
字数 2330
阅读 936
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-toolshostname melodylinux.comhostnamectl set-hostname melodylinuxcat /etc/hostnamehostnamectl statusyum install -y bash-completionsource /etc/profilehostnamectl set-hostname
service network restartsystemctl restart network.servicesystemctl stop network.servicechkconfig nginx onsystemctl enable nginx.servicesystemctl disable nginx.servicesystemctl status network.servicesystemctl list-units --type=service/usr/lib/systemd/system/
systemctl status firewalldsystemctl list-units --type=service |grep firewalldsystemctl stop firewalldsystemctl disable firewalldsystemctl list-units --type=service |grep firewalldyum install -y iptables-servicessystemctl enable iptables.servicesystemctl start iptables.serviceiptables -nvLiptables -nvLiptables -t nat -nvLservice iptables saveservice iptables restartsystemctl restart iptables.service
systemctl stop iptablessystemctl disable iptablessystemctl enable firewalldsystemctl start firewalldfirewall-cmd --get-default-zonefirewall-cmd --get-zoneswork drop internal external trusted home dmz public block
firewall-cmd --get-default-zonefirewall-cmd --set-default-zone workfirewall-cmd --get-zone-of-interface=ens33firewall-cmd --zone=public --add-interface=lofirewall-cmd --get-zone-of-interface=lofirewall-cmd --zone=home --change-interface=lofirewall-cmd --zone=home --remove-interface=lofirewall-cmd --get-active-zones
firewall-cmd --add-port=12222/tcp --permanentfirewall-cmd --reload/etc/firewalld/zonesfirewall-cmd --permanent --zone=home --add-forward-port=port=22:proto=tcp:toaddr=127.0.0.2success
# 启动同步时间服务cd /etc/systemd/system/multi-user.target.wants/ll /usr/lib/systemd/system/ |grep ntpsystemctl start ntpdate.service
#查看时区命令timedatectl status#修改时区命令timedatectl set-timezone Asia/Shanghai
ntpdate time.pool.aliyun.com
```