您的位置:首页 > 理论基础 > 计算机网络

VM安装CentOS6.5 minimal 过程(均来源于网络,按照自己的安装过程整理下,方便以后查找)

2014-01-28 16:29 597 查看
安装CentOS6.5 minimal 版本后,不能联网,没有wget,ssh等。需要如下设置:

1.设置网络

a.设置IP

vi /etc/sysconfig/network-script/ifcfg-eth0

默认是自动获取IP,如果不需要静态IP,只需修改如下2个选项:

ONBOOT="yes"

MM_Controlled="no"

BOOTPROTO="dhcp"
# 默认的

如果采用静态IP,则还需要添加或修改:

BOOTPROTO=static

IPADDR=192.168.1.7

NETMASK=255.255.255.0

b.修改网关

vi
/etc/sysconfig/network

GATEWAY=192.168.1.1
#添加

c.修改DNS

#
vi /etc/resolv.conf

nameserver 8.8.8.8 #添加,这里是google域名服务器,可以根据实际情况修改 

d.重新启动网络配置

#
service network restart



# /etc/init.d/network restart

2.修改yum源为163的

a.安装wget

#yum install wget

b.下载跟新yum源

# cd /etc/yum.repos.d/
# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo # mv CentOS-Base.repo CentOS-Base.repo.bak
# mv CentOS6-Base-163.repo CentOS-Base.repo
# yum clean all && yum makecache && yum update -y

3.添加sudo用户

#adduser
Alsmile

#passwd
Alsmile

修改/etc/sudoers
文件,找到下面一行,在root下面添加一行,如下所示:

## Allow root to run any commands anywhere

root ALL=(ALL) ALL

Alsmile ALL=(ALL) ALL

4.然后可以用xshell连接了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: