最新消息:创业路上,需要创新思维,也需要知识的沉淀。

CentOS搭建Samba 实现虚拟机与本机文件共享

Linux myfse 250浏览

本次是在CentOS环境,如果是Ubuntu请用apt-get,简单明了,自己成功搭建运行。实现虚拟机与本机文件共享。

1、安装samba

yum install samba system-config-samba samba-client samba-common

2、创建www账号

/usr/sbin/groupadd www
/usr/sbin/useradd -g www www
mkdir -p /data0/knose/
chmod 777 /data0/knose/
mkdir -p /data0/htdocs/
chown -R www:www /data0/htdocs/
chmod 777 /data0/htdocs/
cat /etc/passwd | mksmbpasswd.sh> /etc/samba/smbpasswd

3、创建samba配置文件

mv -f /etc/samba/smb.conf /etc/samba/smb.conf.bak
vi /etc/samba/smb.conf

4、配置

[global]
server string = Samba Server
security = user
encrypt passwords = yes 
smb passwd file = /etc/samba/smbpasswd

[knose]
workgroup = root
netbios name = root
path = /data0/knose
browseable = yes
writeable = yes

[web] 
workgroup = www
netbios name = www
path = /data0/htdocs
browseable = yes
writeable = yes

5、为samba用户www、root设立一个密码:

smbpasswd -a www
smbpasswd -a root

6、启动samba :

/sbin/service smb start

7.Windows配置

CentOS搭建Samba 实现虚拟机与本机文件共享

转载请注明:全端网 » CentOS搭建Samba 实现虚拟机与本机文件共享