ubuntu在混合环境中创建和配置文件共享

1. apt-get install samba

2. sudo vi /etc/samba/smb.conf
在【global】下添加
usershare owner only = false
重启 sudo service smbd restart

3. 采用usershare设置共享目录
net usershare add [-l|--long] <sharename> <path> [<comment>] [<acl>] [<guest_ok=[y|n]>]
Adds the specified share name for this user.
<sharename> is the new share name.
<path> is the path on the filesystem to export.
<comment> is the optional comment for the new share.
<acl> is an optional share acl in the format “DOMAIN\name:X,DOMAIN\name:X,….”
<guest_ok=y> if present sets “guest ok = yes” on this usershare.
“X” represents a permission and can be any one of the characters f, r or d
where “f” means full control, “r” means read-only, “d” means deny access.
name may be a domain user or group. For local users use the local server name instead of “DOMAIN”
The default acl is “Everyone:r” which allows everyone read-only access.
Add -l or –long to print the info on the newly added share.

4. 可以手动修改共享目录配置

/var/lib/samba/usershares/<sharename>

原文地址:https://www.cnblogs.com/uniqid/p/5699126.html