Linux系统Mini版配置相关

一:修改ip

    编辑:vi /etc/sysconfig/network-sc/ifcfg-eth0 配置如下图:

    进入到:cd /etc/udev/rules.d/       删除:70-persisitent-net.rules

    重启服务器:init 6

    测试:ping www.baidu.com 

二、永久修改hostname

  编辑:vi /etc/sysconfig/network

三、关闭防火墙

  查看防火墙状态   

   service iptables status

  开启或者停止防火墙
      service iptables start | stop
     永久关闭:防火墙
      chkconfig iptables off

  永久关闭:防火墙
      chkconfig iptables on
     查看防火墙开机启动状态:
      chkconfig iptables –list

四:ssh免密登录问题

      ssh-keygen
      ssh-copy-id 目标ip地址(包含自己的也要ssh)
      vi /etc/hosts

五:解决Mini版本ssh-copy-id awen01 等命令找不到问题

  问题如下图:

    

  解决方案:

    方案1、执行如下命令:

       yum -y install openssh-clients

    方案2、如果ssh-copy-id 在远程服务器不存在;如上图     

      可以尝试用一下命令解决,直接复制本地的pubkey内容到远程服务器;

    即到awen02或者awen03中执行以下

      cat ~/.ssh/id_*.pub | ssh  hadoop@awen02'cat >> .ssh/authorized_keys'

六:显示绝对路径

  修改: vi /etc/prifile

  绝对路径显示:export PS1='[\u@\h pwd]$'           

  source: source /etc/profile

猜你喜欢

转载自www.cnblogs.com/gentle-awen/p/9860254.html