0

can someone please confirm the following. I would like 2 methods of accessing the same 4 samba folders

  1. by me user john, with read/write permissions, accessed via user/pass
  2. by any guest with read permissions only.

do i do this by editing the smb.conf file

Create a new user first: sudo useradd samba-guest. Search your smb.conf for guest account. Set this to samba-guest (guest account = samba-guest).

and then have a second user called john and then in the smb.conf file, set the access for john to be read/write

will that do it? thanks

p.s do i need to use chown or anything like that? p.p.s the information here is relevant?

or is this even possible

0

I'll give you a couple of ways:

But First: Remove the guest account = samba-guest line from smb.conf. There already is a guest account set up by default and it's name is "nobody". You can verify this yourself if you want:

testparm -sv /dev/null | grep "guest account"

** One way to do this is with a share definition that looks something like this:

[Test]
path = /mnt/Test
guest ok = yes
read only = yes
write list = jim
create mask = 0755

Just make sure that Test is owned by jim:

sudo chown jim /mnt/Test

It will be read only to everyone but jim. If your clients are running either Linux or macOS they will always be offered a choice of connecting as anonymous / guest or with a user name. Worse case you can use Connect-to-Server in either OS to force credentials. Windows is the problem child since it will not be prompted to what it sees as a guest share. One way around this is to "map" the "drive" which is the closest thing in Windows to Connect-to-Server.

** Another way is to force a credentials prompt for everyone ( guest ok = no ) but still only allow a write by jim:

[Test]
path = /mnt/Test
guest ok = no
read only = yes
write list = jim
create mask = 0755

Here the guest user would submit the user samba-guest with it's samba password.

** And remember to add these user(s) to the samba password database:

sudo smbpasswd -a jim
sudo smbpasswd -a samba-guest

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.