Centos7安装后初始化操作
2016-12-07 11:40
330 查看
一.配置当前用户为sudoer
1:切换到root用户
2 :赋予普通用户root权限
编辑/etc/sudoers配置文件,找到下面一行,在root下面添加一行,如下所示:
root ALL=(ALL) ALL
test ALL=(ALL) ALL
修改完毕,现在可以用test帐号登录,然后用命令 su - ,即可获得root权限进行操作。
3:退出root用户
二.配置网络(这一步可在安装时省略)
三.更换源
1:切换到root用户
[test@iZ2513wqj05Z app]$ su root Password: [root@iZ2513wqj05Z app]#[/code]
2 :赋予普通用户root权限
编辑/etc/sudoers配置文件,找到下面一行,在root下面添加一行,如下所示:
root ALL=(ALL) ALL
test ALL=(ALL) ALL
修改完毕,现在可以用test帐号登录,然后用命令 su - ,即可获得root权限进行操作。
3:退出root用户
[root@iZ2513wqj05Z app]# exit exit [test@iZ2513wqj05Z app]$[/code]
二.配置网络(这一步可在安装时省略)
CentOS网络配置: 1. 使用root账户登录; 2. 切换当前目录:cd /etc/sysconfig/network-scripts/ 3. 通过vi ifcfg-enp0s3打开网络配置文件; 4. 修改网络配置文件并保存: BOOTPROTO=dhcp(删除或使用#号注释该行,即可开启静态设置模式) ONBOOT=YES(表示自动加载) IPADDR0=192.168.2.120 GATEWAY0=192.168.2.1 DNS1=192.168.2.1 5. 重启网络服务: service network restart 6. 使用ifconfig(CentOS 6)或者ip addr/link(CentOS 7)命令查看当前网络状态,测试网络配置是否生效;
三.更换源
1、备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2、下载新的CentOS-Base.repo 到/etc/yum.repos.d/
CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo[/code]
CentOS 6wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo[/code]
CentOS 7wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo[/code]
3:运行yum makecache生成缓存
yum clean all
yum makecache
相关文章推荐
- asp.net TreeView安装、使用(如何将TreeView打包发布)(带CheckBox选择框的TreeView的初始化,TreeView客户端操作:选择父节点后自动选择所有子节点,子节点选择后自动选择父节点)(TreeView节点精确定位)
- vmware 安装CentOS7无法执行64位操作
- centos7系统下nginx安装并配置开机自启动操作
- asp.net TreeView安装、使用(如何将TreeView打包发布)(带CheckBox选择框的TreeView的初始化,TreeView客户端操作:选择父节点后自动选择所有子节点,子节点选择后自动选择父节点)(TreeView节点精确定位)
- mariaDB安装完成后设置root密码等初始化操作
- asp.net TreeView安装、使用(如何将TreeView打包发布)(带CheckBox选择框的TreeView的初始化,TreeView客户端操作:选择父节点后自动选择所有子节点,子节点选择后自动选择父节点)(TreeView节点精确定位)
- SpringCloud(第 052 篇)CentOS7 安装 Docker 以及常用操作命令讲解
- CentOs7 docker 安装与基本操作
- Centos7安装zabbix2.4并进行初始化配置
- CentOS7 KVM 安装 、开关机等常用操作(1)
- 新安装的金蝶K3软件,初始化后,在基础资料中对于币别,科目,部门,客户等资料均无法新增,无法引出,等操作,K3CASysSet.dll
- CentOS7系统安装及初始化
- asp.net TreeView安装、使用(如何将TreeView打包发布)(带CheckBox选择框的TreeView的初始化,TreeView客户端操作:选择父节点后自动选择所有子节点,子节点选择后自动选择父节点)(TreeView节点精确定位)2005-12-23更新
- Docker安装与基本操作(CentOS7)
- mysql安装初始化操作报错“FATAL ERROR: Could not find mysqld”
- MySQL读书笔记-安装初始化操作
- MariaDB安装、初始化及常用操作
- centos7安装好,自用的初始化脚本
- SpringCloud(第 052 篇)CentOS7 安装 Docker 以及常用操作命令讲解