作开发的时候,常常为了某系列的项目,专门就搞一个虚拟机,安装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