Hello, I'm trying to access a Samba share as anonymous/guest user, so I have added the following entry inf file smb.conf (Samba 4.9) guest account = andrea map to guest = bad user ... [test] available = yes browsable = yes guest ok = yes nfs4: acedup = merge nfs4: mode = special path = /var/tmp/test read only = no and the shared directory /var/tmp/test has the following permission (so user andrea is the owner): # ls -ld /var/tmp/test/ drwx------ 5 andrea root 5 Oct 16 11:05 /var/tmp/test/ The client can mount the share as anonymous (user urca doesn't exist) but can't read or write: root at andrea-virtual-machine:~# mount -t cifs //node1/test /mnt2 -o username=urca,domain=hyperfile.local Password for urca@//node1/test: root at andrea-virtual-machine:~# cd /mnt2 root at andrea-virtual-machine:/mnt2# df -h . Filesystem Size Used Avail Use% Mounted on //node1/test 4,2T 2,1T 2,2T 49% /mnt2 root at andrea-virtual-machine:/mnt2# touch pippo touch: cannot touch 'pippo': Permission denied root at andrea-virtual-machine:/mnt2# ls ls: reading directory '.': Permission denied am I misunderstanding something about Samba anonymous access? Thanks Andrea
On Wed, 23 Jan 2019 16:56:42 +0100 Andrea Cucciarre' via samba <samba at lists.samba.org> wrote:> Hello, > > I'm trying to access a Samba share as anonymous/guest user, so I have > added the following entry inf file smb.conf (Samba 4.9) > > guest account = andrea > map to guest = bad user > ... > [test] > available = yes > browsable = yes > guest ok = yes > nfs4: acedup = merge > nfs4: mode = special > path = /var/tmp/test > read only = no > > and the shared directory /var/tmp/test has the following permission > (so user andrea is the owner): > > # ls -ld /var/tmp/test/ > drwx------ 5 andrea root 5 Oct 16 11:05 /var/tmp/test/ > > The client can mount the share as anonymous (user urca doesn't exist) > but can't read or write: > > root at andrea-virtual-machine:~# mount -t cifs //node1/test /mnt2 -o > username=urca,domain=hyperfile.local > Password for urca@//node1/test: > > root at andrea-virtual-machine:~# cd /mnt2 > > root at andrea-virtual-machine:/mnt2# df -h . > Filesystem Size Used Avail Use% Mounted on > //node1/test 4,2T 2,1T 2,2T 49% /mnt2 > > root at andrea-virtual-machine:/mnt2# touch pippo > touch: cannot touch 'pippo': Permission denied > root at andrea-virtual-machine:/mnt2# ls > ls: reading directory '.': Permission denied > > am I misunderstanding something about Samba anonymous access? >Yes ;-) You are trying to use a known user as a guest user, try reading this: https://wiki.samba.org/index.php/Setting_up_Samba_as_a_Standalone_Server Rowland
I'm not sure I have understood, I'm mounting the share as "urca" user, which is not a known user. Although I'm setting smb.conf so that for guest user it uses the privileges of the known user "andrea" Could you please advice on what I should set for "guest account" in smb.conf? Thanks Andrea Il 1/23/2019 5:15 PM, Rowland Penny via samba ha scritto:> On Wed, 23 Jan 2019 16:56:42 +0100 > Andrea Cucciarre' via samba <samba at lists.samba.org> wrote: > >> Hello, >> >> I'm trying to access a Samba share as anonymous/guest user, so I have >> added the following entry inf file smb.conf (Samba 4.9) >> >> guest account = andrea >> map to guest = bad user >> ... >> [test] >> available = yes >> browsable = yes >> guest ok = yes >> nfs4: acedup = merge >> nfs4: mode = special >> path = /var/tmp/test >> read only = no >> >> and the shared directory /var/tmp/test has the following permission >> (so user andrea is the owner): >> >> # ls -ld /var/tmp/test/ >> drwx------ 5 andrea root 5 Oct 16 11:05 /var/tmp/test/ >> >> The client can mount the share as anonymous (user urca doesn't exist) >> but can't read or write: >> >> root at andrea-virtual-machine:~# mount -t cifs //node1/test /mnt2 -o >> username=urca,domain=hyperfile.local >> Password for urca@//node1/test: >> >> root at andrea-virtual-machine:~# cd /mnt2 >> >> root at andrea-virtual-machine:/mnt2# df -h . >> Filesystem Size Used Avail Use% Mounted on >> //node1/test 4,2T 2,1T 2,2T 49% /mnt2 >> >> root at andrea-virtual-machine:/mnt2# touch pippo >> touch: cannot touch 'pippo': Permission denied >> root at andrea-virtual-machine:/mnt2# ls >> ls: reading directory '.': Permission denied >> >> am I misunderstanding something about Samba anonymous access? >> > Yes ;-) > > You are trying to use a known user as a guest user, try reading this: > > https://wiki.samba.org/index.php/Setting_up_Samba_as_a_Standalone_Server > > Rowland > > >