Cent Os 常用操作

  • 开放端口

          编辑iptables文件(/etc/sysconfig/iptables)

          -A INPUT -m state --state NEW -m tcp -p tcp --dport xx端口号 -j ACCEPT

          重启iptables  /etc/init.d/iptables restart

  • 修改dns

          编辑resolv.conf(/etc/resolv.conf)

          nameserver  8.8.8.8

  • 修改时区

          先安装ntp    yum install ntp

         设置ntp服务器: ntpdate us.pool.ntp.org

         设置时区:cp –f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime #reboot

         重启: shutdown –r now

         查看当前时间:date -R

原文地址:https://www.cnblogs.com/hanwwly/p/3381274.html