程序员人生 网站导航

Windows虚拟机中的ubuntu文件夹共享设置

栏目:服务器时间:2014-02-21 12:42:02

此方法不可以向windows共享Linux的root下的文件夹!

假设要共享windows虚拟机中的ubuntu下的文件夹source

在ubuntu下执行:
#sudo apt-get install samba

#sudo apt-get install smbfs

#chmod 777 source

sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup

sudo gedit /etc/samba/smb.conf

搜索这行:

  security = user

改为这两行:

  security = user
  username map = /etc/samba/smbusers

在文件最后添加代码:

[source]
comment=Yiru
read only=no
path = /source
guest ok=yes
available = yes
browsable = yes
public = yes
writable = yes
第一行[source]是在windows下显示的文件夹名,可以随意取;第二行comment,注释,随意取;第三行不用说;第四行path,千万注意,不可以是root以及root下的文件夹

另外,重启samba的命令是这个,不过上述步骤不需要用到:

sudo /etc/init.d/smbd restart

------分隔线----------------------------
------分隔线----------------------------

最新技术推荐