centos7 安裝後初始化配置

一.配置當前用戶爲sudoer緩存

 1:切換到root用戶ruby

[test@x-sco]$ su root Password: [root@x-sco]#

 2 :賦予普通用戶root權限網絡

   編輯/etc/sudoers配置文件,找到下面一行,在root下面添加一行,以下所示:
  root ALL=(ALL) ALL
  test ALL=(ALL) ALL
  修改完畢,如今能夠用test賬號登陸,而後用命令 su - ,便可得到root權限進行操做。
測試

 3:退出root用戶spa

  [root@x-sco]# exit   exit   [test@x-sco]$x-scox-sco

 

二.配置網絡(這一步可在安裝時省略)rest

  1. 使用root帳戶登陸;
  2. 切換當前目錄:cd /etc/sysconfig/network-scripts/
  3. 經過vi ifcfg-enoxxxx打開網絡配置文件;
  4. 修改網絡配置文件並保存:
  BOOTPROTO=dhcp(刪除或使用#號註釋該行,便可開啓靜態設置模式)
  ONBOOT=YES(表示自動加載)
  IPADDR0=192.168.1.xxx
  GATEWAY0=192.168.1.1
  DNS1=192.168.1.1
  5. 重啓網絡服務:
  service network restart
  6. 使用ifconfig(CentOS 6)或者ip addr/link(CentOS 7)命令查看當前網絡狀態,測試網絡配置是否生效;

  三.更換源code

  一、備份 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

  二、下載新的CentOS-Base.repo 到/etc/yum.repos.d/ip

         wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

    3:運行yum makecache生成緩存get

  yum clean allit

  yum makecache

相關文章
相關標籤/搜索