就像标题中说的那样,我想在我的 samba 服务器上创建一个文件夹,允许任何人(来宾、用户)上传文件。然后文件对于主机以外的任何人来说都是不可见的。最好的选择是禁止用户和来宾编辑、查看或删除文件,但这不是必须的。我尝试了一些方法。首先,就像有人在某个地方写的那样,我曾经这样做过,使用掩码和文件权限,但它不起作用,任何人都可以对服务器上的文件做任何事情。当然,我们对“Wgrane”文件夹感兴趣 :P 。
[global]
netbios name = serwer
server string = Samba file and print server
workgroup = Workgroup
security = user
hosts allow = 127. 192.168.0.
interfaces = 127.0.0.1/8 192.168.0.0/24
bind interfaces only = yes
remote announce = 192.168.0.255
remote browse sync = 192.168.0.255
printcap name = cups
load printers = yes
cups options = raw
printing = cups
guest account = smbguest
map to guest = Bad Password
obey pam restrictions = yes
log file = /var/log/samba/samba.log
max log size = 1000
null passwords = yes
username level = 0
password level = 0
encrypt passwords = yes
unix password sync = yes
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
local master = no
domain master = no
preferred master = no
domain logons = no
os level = 33
logon drive = m:
logon home = \\%L\homes\%u
logon path = \\%L\profiles\%u
logon script = %G.bat
time server = no
name resolve order = wins lmhosts bcast
wins support = no
wins proxy = no
dns proxy = no
preserve case = no
client use spnego = no
client signing = no
client schannel = no
server signing = no
server schannel = no
nt pipe support = yes
nt status support = yes
allow trusted domains = no
obey pam restrictions = yes
enable spoolss = yes
client plaintext auth = no
disable netbios = no
follow symlinks = no
update encrypted = yes
pam password change = no
passwd chat timeout = 120
hostname lookups = no
username map = /etc/samba/smbusers
passdb backend = tdbsam
passwd program = /usr/bin/passwd '%u'
passwd chat = *New*password* %n\n *ReType*new*password* %n\n *passwd*changed*\n
add user script = /usr/sbin/useradd -d /dev/null -c 'Samba User Account' -s /dev/null '%u'
add user to group script = /usr/sbin/useradd -d /dev/null -c 'Samba User Account' -s /dev/null -g '%g' '%u'
add group script = /usr/sbin/groupadd '%g'
delete user script = /usr/sbin/userdel '%u'
delete user from group script = /usr/sbin/userdel '%u' '%g'
delete group script = /usr/sbin/groupdel '%g'
add machine script = /usr/sbin/useradd -d /dev/null -g sambamachines -c 'Samba Machine Account' -s /dev/null -M '%u'
machine password timeout = 120
idmap uid = 16777216-33554431
idmap gid = 16777216-33554431
template shell = /dev/null
winbind use default domain = yes
winbind separator = @
winbind cache time = 360
winbind trusted domains only = yes
winbind nested groups = no
winbind nss info = no
winbind refresh tickets = no
winbind offline logon = no
host msdfss = no
usershare allow guests = yes
[krzysztofonly]
path = /home/krzysztof/Publiczny/Serwer
comment = Serwer tylko dla usera krzysztof.
valid users = krzysztof
write list = krzysztof
read only = no
available = yes
browseable = yes
writable = yes
guest ok = no
public = yes
printable = no
locking = no
strict locking = no
[Do pobrania]
path = /home/krzysztof/Publiczny/Do pobrania
comment = Lokalizacja tylko do pobierania plików z serwera.
read only = yes
available = yes
browseable = yes
writable = no
guest ok = yes
public = yes
printable = no
locking = yes
strict locking = yes
[Wgrane]
path = /home/krzysztof/Publiczny/Wgrane
comment = Lokalizacja do wgrywania plików na serwer. Nie mogą one być później edytowane.
force directory mode = 2770
create mask = 660
read only = no
available = yes
browsable = yes
guest ok = yes
public = yes
valid users = @U smbguest
force user = krzysztof
我曾经尝试过的第二种方法是这样的。
[Wgrane]
path = /home/krzysztof/Publiczny/Wgrane
comment = Lokalizacja do wgrywania plików na serwer. Nie mogą one być później edytowane.
read only = no
available = yes
browsable = yes
guest ok = yes
public = yes
veto files = /*/
delete veto files = no
只需否决即可隐藏所有文件,一切都应该没问题。或者也许我对这个归因理解不正确?对 - 文件是隐藏的,但没有办法上传文件。出现错误:https://i.stack.imgur.com/oAePT.png
标准 Windows 错误。“无法找到此项。此项不再位于...”,但该文件完全可以访问,但无法拖放到服务器。
有人可以告诉我如何修复第二种方法中的错误或者告诉我为什么第一种方法不起作用吗?
@edit 我学到了很多,现在我明白了否决文件的工作原理。我需要做一些类似否决的事情,但允许上传。这可能吗?