Guest write Samba [SOLVED]

Questions about applications and software
Forum rules
Before you post please read this

Guest write Samba [SOLVED]

Postby Burningfly on Tue Jan 29, 2013 4:37 am

I can't seem to get my samba share able to be accessed for writing by a guest. Here are the settings

I can't seem to get my samba share able to be accessed for writing by a guest. Here are the settings. The /Terriblebyte has read, write and execute permissions set for the guest...
Any pointers?

[global]
server string =
null passwords = Yes
guest account = nobody
username map = /etc/samba/smbusers
syslog only = Yes
announce version = 5.0
name resolve order = hosts wins bcast
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192
printcap name = CUPS
wins support = Yes
idmap config * : backend = tdb


[Terriblebyte]
comment = The Terriblebyte
path = /Terriblebyte
force user = d
force group = d
read only = No
create mask = 0777
directory mask = 0777
guest ok = Yes
public = yes
only guest = yes
Last edited by Burningfly on Tue Jan 29, 2013 8:52 pm, edited 1 time in total.
Burningfly
Level 1
Level 1
 
Posts: 7
Joined: Tue Oct 02, 2012 10:18 pm

Linux Mint is funded by ads and donations.
 

Re: Guest write Samba

Postby altair4 on Tue Jan 29, 2013 7:32 am

What are the Linux permissions of the shared directory:
Code: Select all
ls -dl /Terriblebyte

Does it allow a write by the user specified by "force user = d" ?

Side Note: You have no Windows samba clients? The reason I bring this up is because you removed an option that makes anonymous guest access by a Windows client possible:
Code: Select all
map to guest = Bad User

If you run the following command you will see that without that line it defaults to "Never":
Code: Select all
testparm -sv | grep "map to guest"
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 13
Level 13
 
Posts: 4660
Joined: Tue Feb 03, 2009 10:27 am

Re: Guest write Samba

Postby Burningfly on Tue Jan 29, 2013 4:50 pm

Oops, I didn't mean to remove the map to guest option...
And the permissions are:
drwxrwxrwx 1 root plugdev 4096 Jan 29 03:45 /Terriblebyte/

That means that anyone, not just the user 'd' should be able to write to it, correct?
I also tried the user 'nobody' but that didn't work either...
Burningfly
Level 1
Level 1
 
Posts: 7
Joined: Tue Oct 02, 2012 10:18 pm

Re: Guest write Samba

Postby altair4 on Tue Jan 29, 2013 5:02 pm

Just to make it clear.

All of your clients are being converted to the user "d" and the Linux permissions will allow then to read and write to the shared folder.

But if your clients are running windows and they are not in the samba password database then you have to include the "map to guest = Bad User" line to your smb.conf in the [global] section.

A Windows user automatically passes their username and password when it accesses a Samba host. Samba tries to find a match in the password database for that user. If you have "map to guest = Bad User" when it finds no match it will be tagged as a "Bad User" and converted to the default guest account which is "nobody". In your share definition "nobody" is then converted to "d".

But without that line this whole thing falls apart and the server will deny access to that user because the default is set to "map to guest = Never".
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 13
Level 13
 
Posts: 4660
Joined: Tue Feb 03, 2009 10:27 am

Re: Guest write Samba

Postby Burningfly on Tue Jan 29, 2013 5:49 pm

I added back the line, but while it allows me access, it is still read only. Oddly it didn't stop working (and ask for a password) when I had the map to guest option missing...
Windows says I need permission from Root to write a file..

I am restarting the smdb and nmbd after each edit with
Code: Select all
sudo restart smbd
sudo restart nmbd
Burningfly
Level 1
Level 1
 
Posts: 7
Joined: Tue Oct 02, 2012 10:18 pm

Re: Guest write Samba

Postby altair4 on Tue Jan 29, 2013 5:56 pm

Define "write" please.

If a directory is set to 777 UserA can write to the folder meaning that he can add to or delete anything in it. But if you have a file whose owner is UserB, UserA can delete the file but UserA cannot edit the file.

Can the client add a new file to the share?
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 13
Level 13
 
Posts: 4660
Joined: Tue Feb 03, 2009 10:27 am

Re: Guest write Samba

Postby Burningfly on Tue Jan 29, 2013 6:12 pm

A guest cannot create a new file in the share. I just try to create a new empty file.

And now, for reasons unknown, I can't navigate to the windows network on the host, or see the machine in network places via windows. I can only access the share with the IP address...
Burningfly
Level 1
Level 1
 
Posts: 7
Joined: Tue Oct 02, 2012 10:18 pm

Re: Guest write Samba

Postby Burningfly on Tue Jan 29, 2013 6:44 pm

my updated smb.conf file is as follows:
[global]
server string = %h server (Samba, LinuxMint)
guest account = nobody
username map = /etc/samba/smbusers
map to guest = Bad User
syslog only = Yes
announce version = 5.0
name resolve order = hosts wins bcast
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192
printcap name = CUPS
wins support = Yes
idmap config * : backend = tdb

[Terriblebyte]
comment = The Terriblebyte
path = /Terriblebyte/
writeable = yes
create mask = 0777
directory mask = 0777
guest only = Yes
browseable = yes
guest ok = yes
read only = no

i added the user nobody to the /etc/samba/smbusers file
Burningfly
Level 1
Level 1
 
Posts: 7
Joined: Tue Oct 02, 2012 10:18 pm

Re: Guest write Samba

Postby altair4 on Tue Jan 29, 2013 7:03 pm

Your obsessing about nobody. "guest account = nobody" is the default so there is no need to add it to smb.conf or anywhere else.

Why do you have this:
[quote]username map = /etc/samba/smbusers
What's in smbusers?

BTW, You have set your machine up as a WINS server is that what you intended.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 13
Level 13
 
Posts: 4660
Joined: Tue Feb 03, 2009 10:27 am

Re: Guest write Samba

Postby Burningfly on Tue Jan 29, 2013 7:19 pm

Ok, so I got the share to work by resetting the smb.conf file to default, and using nemo to share the folder. I tried it originally, but since then I must have fixed the original issue in my tinkering.
Thank you for your help.

The only issue I have now is that it won't display unless the IP address is entered. There are worse things I suppose.
But given a default smb.conf file, do you know why I mightn't be able to see the computer with windows, or why navigating to "Windows Network" in Mint would give a "Failed to retrieve share list from server" error?
Burningfly
Level 1
Level 1
 
Posts: 7
Joined: Tue Oct 02, 2012 10:18 pm

Re: Guest write Samba

Postby altair4 on Tue Jan 29, 2013 7:25 pm

2 possible reasons:

** Your hostname is too long.

If it's 16 characters or more it's invisible to the lan. Fix it this way:
Code: Select all
netbios name = something

Put it right under the workgroup line and make sure "something" is 15 characters or less in length

** THe name resolve order needs to be rearranged if this is a home lan:
Code: Select all
name resolve order = bcast host lmhosts wins


Then restart samba:
Code: Select all
sudo service smbd restart
sudo service nmbd restart


Wait a few minutes and then see how it goes.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 13
Level 13
 
Posts: 4660
Joined: Tue Feb 03, 2009 10:27 am

Re: Guest write Samba [SOLVED]

Postby Burningfly on Tue Jan 29, 2013 7:50 pm

I didn't have a netbios name at all set, now that it is, everything seems to be in fine working order. Thank you kindly!
Burningfly
Level 1
Level 1
 
Posts: 7
Joined: Tue Oct 02, 2012 10:18 pm

Linux Mint is funded by ads and donations.
 

Return to Software & Applications

Who is online

Users browsing this forum: i15Fwy and 13 guests