作開發的時候,常常爲了某系列的項目,專門就搞一個虛擬機,安裝RHEL、Fedora、CentOS之類的進行開發。由於是虛擬機,也常常使用root帳戶就直接上了。html
這裏記錄一下使用RHEL系列虛擬機,安裝完畢後如何創建編譯環境的傻瓜過程。linux
本文地址:http://www.javashuo.com/article/p-wegtcrdw-mh.htmlshell
這裏直接參考這個文章就好了:CentOS 7下配置本地yum源及yum客戶端,看小節 「2、配置本地yum源」 便可。segmentfault
xinetd
和tftp-server
/etc/xinetd.d/tftp
中,指定tftp的目錄,而且將"disable"置爲「no」iptables
(若是你會設置的話那就進行相關設置,無需關閉)。可使用ntsysv
來設置開機關閉關閉selinux
:.net
# vi /etx/sysconfig/selinux
,將type
改成disabled
# setenforce 0
xinetd
(會同時啓動 tftp server) # sevice xinetd restart
# vi /etc/selinux/config
,設置爲SELINUX=disabled
(1) 編輯/etc/samba/smb.conf
,添加如下內容:unix
[root] path = / valid users = root create mask = 0600 directory mask = 0700 writable = yes browsable = yes guest ok = no
另外,找到security=user
,添加/修改如下內容:rest
smb passwd file = /etc/samba/smbpasswd passdb backend = smbpasswd
(2) # service smb restart
(3) # passwd root
修改root的密碼。注意這個會同時修改系統root的密碼。若是你要添加帳戶,則使用# useradd -s /sbin/nologin xxx
(4) # smbpasswd -a root
(5) 在Windows中清除保存的密碼:control keymgr.dll
(6) 在客戶端:
# mount -t cifs //192.168.1.100/root /mnt -o username=root
code
網上的辦法可能是基於portmap的,可是在CentOS中,portmap被rpcbind
取代了,所以配置的方法也不同。server
須要安裝的rpm文件有:libgssglue
, libtirpc
, rpcbind
, nfs
htm
安裝以後配置順序爲:
# vi /etc/exports
添加一行/tftpboot/rootfs *(rw, no_root_squash)
,其中 *
表示容許任意的IP地址
# service nfs restart; export fs
# mount -t nfs -o nolock 192.168.1.100:/tftpboot/rootfs /mnt