• 1、rhel 6.5 系统准备


    1、启动、关闭、重置服务    (rhel7 为 systemctl)

    1. [root@rhel-6 ~]# service atd status #关闭atd服务
    2. atd 已停
    3. [root@rhel-6 ~]# service atd start #启动atd服务
    4. 正在启动 atd [确定]
    5. [root@rhel-6 ~]# service atd stop #停止atd服务
    6. 停止 atd [确定]
    7. [root@rhel-6 ~]# service atd restart #重启atd服务
    8. 停止 atd [失败]
    9. 正在启动 atd [确定]
    10. [root@rhel-6 ~]# service atd reload #重置atd服务
    11. 停止 atd [确定]
    12. 正在启动 atd [确定]


    2、设置服务开机自启或关机自启

    1. [root@rhel-6 ~]# chkconfig atd on #设置atd服务开机自启
    2. [root@rhel-6 ~]# chkconfig --list atd #查看atd服务各启动级别开机启动情况
    3. atd 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭
    4. [root@rhel-6 ~]# chkconfig atd off #设置atd服务不开机自启
    5. [root@rhel-6 ~]# chkconfig --list atd #查看atd服务各启动级别开机启动情况
    6. atd 0:关闭 1:关闭 2:关闭 3:关闭 4:关闭 5:关闭 6:关闭

    3、清空iptables (关闭防火墙)

    1. [root@rhel-6 ~]# iptables -F #清空防火墙配置
    2. [root@rhel-6 ~]# service iptables save #保存防火墙配置
    3. iptables:将防火墙规则保存到 /etc/sysconfig/iptables [确定]
    4. [root@rhel-6 ~]# chkconfig iptables off #关闭防火墙自启
    5. [root@rhel-6 ~]# chkconfig --list iptables #检查自启情况
    6. iptables 0:关闭 1:关闭 2:关闭 3:关闭 4:关闭 5:关闭 6:关闭


    4、关闭selinux

    1. [root@rhel-6 ~]# getenforce #检查selinux状态
    2. Enforcing #Enforcing 启动状态
    3. [root@rhel-6 ~]# vim /etc/selinux/config #修改selinux配置文件
    4. # disabled - No SELinux policy is loaded.
    5. SELINUX=Disabled #修改为Disabled 并保存
    6. # SELINUXTYPE= can take one of these two values:
    7. [root@rhel-6 ~]# init 6 #重启后使关闭生效


    5、主机名配置

    1. [root@rhel-6 ~]# vim /etc/hosts


    6、光盘自动挂载

    1. [root@rhel-6 ~]# df -h #df -h 查看挂载情况
    2. Filesystem Size Used Avail Use% Mounted on
    3. /dev/sda2 20G 4.5G 15G 24% /
    4. tmpfs 2.0G 0 2.0G 0% /dev/shm
    5. /dev/sda1 194M 34M 150M 19% /boot
    6. /dev/sr0 3.6G 3.6G 0 100% /mnt
    7. [root@rhel-6 ~]# echo "/dev/sr0 /mnt iso9660 defaults 0 0" >> /etc/fstab #在/etc/fstab 配置文件添加echo ""的内容

    7、YUM本地源和网络源

    1. [root@rhel-6 ~]# cat /etc/yum.repos.d/rhel-source.repo
    2. [rhel6-source] #yum名称 随便取
    3. name=rhel-source #yum名称2 随便取
    4. baseurl=file:///mnt #yum源路径,/mnt 是光盘挂载点
    5. enabled=1 #=1 表示启用此源
    6. gpgcheck=0 #=0表示不检查
    7. [root@rhel-6 ~]# yum clean all #清空yum缓存
    8. [root@rhel-6 ~]# yum list #生成新缓存
    9. #配置网络源
    10. [root@xuegod63 ~]# yum list
      [root@xuegod63 ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo #阿里云的源
      [root@xuegod63 ~]# sed -i  's/$releasever/6.8/g' /etc/yum.repos.d/CentOS-Base.repo     
    11. [root@xuegod63 ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo #163的源
    12. [root@xuegod63 ~]# sed -i  's/$releasever/6.8/g' /etc/yum.repos.d/CentOS-Base.repo
    13. [root@xuegod63 ~]# yum clean all
    14. [root@xuegod63 ~]# yum list


    8、网络配置

    1. [root@rhel-6 ~]# setup #setup进入图形配置界面
    2. [root@rhel-6 ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0 #修改网卡配置文件


    9、克隆后工作--修改主机名

    1. [root@rhel-6 ~]# vim /etc/sysconfig/network #RHEL6版本修改主机名
    2. [root@rhel7-14 ~]# hostnamectl set-hostname rhel7-14.com #RHEL7版本修改主机名 后面接新主机名 [root@rhel7-14 ~]# hostnamectl status #RHEL7 查看主机名信息 Static hostname: rhel7-14.com Icon name: computer-vm Chassis: vm Machine ID: 5ed0276bb5324c97bdbcd0ec2bf59834 Boot ID: c5ea02318bbe4137a2558b4420a266a6 Virtualization: vmware Operating System: Red Hat Enterprise Linux Server 7.2 (Maipo) CPE OS Name: cpe:/o:redhat:enterprise_linux:7.2:GA:server Kernel: Linux 3.10.0-327.el7.x86_64 Architecture: x86-64
    1. [root@rhel-6 ~]# rm /etc/udev/rules.d/70-persistent-net.rules #删除此网络缓存文件。里面有MAC记录







  • 相关阅读:
    Python安装(小白教程)中文版Pycharm
    二叉树遍历1
    node* p 和 node *p 和 node * p 的区别
    WinForm中的ListBox组件编程
    C# winform listBox中的项上下移动(转)
    C# ListBox 左移、右移、上移、下移
    C#上移,下移TreeView中的树节点顺序
    C#遍历DataSet与DataSet元素实现代码
    C# 手动编写 DataSet,DataTable 及遍历DataSet中的数据
    【.NET】C#中遍历各类数据集合的方法
  • 原文地址:https://www.cnblogs.com/tail-f/p/6133555.html
Copyright © 2020-2023  润新知