虛拟機下CentOS安裝教程:http://blog.csdn.net/21aspnet/article/details/6961518
由于前一陣子重新裝win7,win7下的虛拟機CentOS也就沒有,重裝中遇到兩個主要問題,記錄一下。
1,連接配接secureCRT問題:
1)切換到root下,ntsysv打開sshd服務,關閉防火牆ip6tables, iptables
2)配置網卡,保證虛拟機能夠上網
[[email protected] ~]$ 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:
[[email protected] centos]# ll /etc/sudoers
-r--r-----. 1 root root 4080 Aug 11 22:47 /etc/sudoers
[[email protected] centos]# chmod +w /etc/sudoers //修改檔案加上w權限,才能夠改寫
[[email protected] 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
。。。。。。
[[email protected] centos]#chmod -w /etc/sudoers //此檔案權限-r--r-----,修改之後需要改回,否則将無法執行sudo
[[email protected] centos]# ll /etc/sudoers
-r--r-----. 1 root root 4080 Aug 11 22:47 /etc/sudoers
[[email protected] centos]# exit
exit
[[email protected] ~]$ sudo ls
mywork
[[email protected] ~]$ OK