虚拟机安装CentOS6.3两个问题

虚拟机下CentOS安装教程:http://blog.csdn.net/21aspnet/article/details/6961518

由于前一阵子重新装win7,win7下的虚拟机CentOS也就没有,重装中遇到两个主要问题,记录一下。

1,连接secureCRT问题:

1)切换到root下,ntsysv打开sshd服务,关闭防火墙ip6tables, iptables

2)配置网卡,保证虚拟机能够上网

[centos@localhost ~]$ ifconfig 
eth0      Link encap:Ethernet  HWaddr 00:0C:29:83:DE:5E  
          inet addr:192.168.1.96  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe83:de5e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1256 errors:0 dropped:0 overruns:0 frame:0
          TX packets:413 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:105296 (102.8 KiB)  TX bytes:101337 (98.9 KiB)
          Interrupt:19 Base address:0x2000 


lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:16 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1080 (1.0 KiB)  TX bytes:1080 (1.0 KiB)


2,创建用户,添加sudo权限,取消每次sudo输入密码,这里已经创建centos用户。

[centos@localhost ~]$ su root
Password: 
[root@localhost centos]# ll /etc/sudoers
-r--r-----. 1 root root 4080 Aug 11 22:47 /etc/sudoers
[root@localhost centos]# chmod +w /etc/sudoers  //修改文件加上w权限,才能够改写
[root@localhost centos]# vim /etc/sudoers

。。。。。。

## The COMMANDS section may have other options added to it.
##
## Allow root to run any commands anywhere 
root    ALL=(ALL)       ALL
centos All=(ALL)       ALL


## Allows members of the 'sys' group to run networking, software, 
## service management apps and more.
# %sys ALL = NETWORKING, SOFTWARE, SERVICES, STORAGE, DELEGATING, PROCESSES, LOCATE, DRIVERS


## Allows people in group wheel to run all commands
# %wheel        ALL=(ALL)       ALL


## Same thing without a password
# %wheel        ALL=(ALL)       NOPASSWD: ALL
%centos  ALL=(ALL) NOPASSWD: NOPASSWD: ALL

。。。。。。

[root@localhost centos]#chmod -w /etc/sudoers //此文件权限-r--r-----,修改之后需要改回,否则将无法执行sudo

[root@localhost centos]# ll /etc/sudoers

-r--r-----. 1 root root 4080 Aug 11 22:47 /etc/sudoers

[root@localhost centos]# exit
exit
[centos@localhost ~]$ sudo ls
mywork
[centos@localhost ~]$ OK

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值