![[ubuntu][原创]samba修改权限让windows访问你的ubuntu共享文件夹](https://img.php.cn/upload/article/001/503/042/175789684181411.jpg)
在Windows系统中,想要像访问本地磁盘一样访问Ubuntu的共享文件夹,其实非常简单。Ubuntu默认集成了Samba服务,只需设置文件夹共享即可实现局域网互通。
首先,在Ubuntu上选择一个要共享的文件夹(例如在
/home
share
sudo mkdir /home/share
然后赋予其完全访问权限:
sudo chmod 777 share
接下来,编辑Samba的主配置文件以开启更高级的共享权限:
sudo vim /etc/samba/smb.conf
在文件末尾添加如下内容:
<pre class="brush:php;toolbar:false;">[share] path = /home/share available = yes browsable = yes public = yes writable = yes
参数说明:
path
available
browsable
public
writable
如果你希望允许多用户共享管理,可能还会遇到如下错误提示:
“net usershare” returned error 255: net usershare add: cannot share path /home/jacky/skynet as we are restricted to only sharing directories we own. Ask the administrator to add the line “usershare owner only = false” to the [global] section of the smb.conf to allow this.
此时需在
[global]
<pre class="brush:php;toolbar:false;">usershare allow guests = yes usershare owner only = false
保存并退出后,重启Samba服务使配置生效:
sudo systemctl restart smbd.service
注意:在Ubuntu 18.04上,使用
sudo service samba restart
systemctl
最后,在Windows端打开“此电脑”,在地址栏输入:
<pre class="brush:php;toolbar:false;">\your_ubuntu_ipshare
例如:
<pre class="brush:php;toolbar:false;">\192.168.1.100share
即可访问共享目录。
但若出现以下提示:
这是由于Windows默认禁用了不安全的来宾访问。解决方法如下:
gpedit.msc
或通过注册表修改(适用于家庭版):
HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesLanmanWorkstationParameters
AllowInsecureGuestAuth
1
完成以上设置后,Windows即可无缝访问Ubuntu的Samba共享文件夹,无需输入用户名和密码,像操作本地磁盘一样方便。
以上就是[ubuntu][原创]samba修改权限让windows访问你的ubuntu共享文件夹的详细内容,更多请关注php中文网其它相关文章!
 
                        
                        Windows激活工具是正版认证的激活工具,永久激活,一键解决windows许可证即将过期。可激活win7系统、win8.1系统、win10系统、win11系统。下载后先看完视频激活教程,再进行操作,100%激活成功。
 
                Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号