After hours of searching, I discovered that the share name and the share directory cannot be the same (and it's not case-sensitive, either). See this post on serverfault.
So, if I change my share name in smb.conf from:
[Music]
to
[Tunes]
I can both read and write to the share. No other changes to my smb.conf were necessary, and no need to chmod 0777.
Answer from the_meter413 on askubuntu.comAfter hours of searching, I discovered that the share name and the share directory cannot be the same (and it's not case-sensitive, either). See this post on serverfault.
So, if I change my share name in smb.conf from:
[Music]
to
[Tunes]
I can both read and write to the share. No other changes to my smb.conf were necessary, and no need to chmod 0777.
Under linux, you need to map your system account to the samba server account.
If you are creating a new user for samba access, then enter the following commands
sudo useradd {user}
sudo passwd {user}
To map a system account to a samba user use the following command
sudo smbpasswd -a {user}
The edit the file /etc/samba/smbusers to map the system account to the samba account, where the system account references the samba account
user = "user"
Ok, figured it out. It wasn't in my samba settings. The error was actually in how I was "permanently" mounting my samba share.
I was doing:
//192.168.1.11/craig /home/craig/musicServer cifs username=craig,password=MYPASSWORD 0 0
but I needed
//192.168.1.11/craig /home/craig/musicServer cifs username=craig,password=MYPASSWORD,file_mode=0777,dir_mode=0777 0 0
Adding both file_mode and dir_mode solved it.
The difference in owner printout is probably due to different UID/GID you have on your local and remote machines.
You can use noperm option at mount instead (no need for file_mode or dir_mode). This option turns off the local file permission check (so UID/GID inconsistency will be okay) and assume the remote identity you authenticated at mount. Remote access control is still enforced.
Hello,
I have a game server running on my machine, and I often move files and folders around.
So I decided to use samba (version 4.7.6-Ubuntu) to create a shared folder (which contains the game server) - and I can't write anything.
The folder is located at /home/locale/Documents.
locale is the username of the account I use to log physically on my machine, and is pretty much the "admin" account. (Note : they don't have root privileges, I'm not that dumb)
To connect to that folder, I use another account, named John. (The username of my Windows account).
I can connect to the share from Windows without any trouble, using the credentials from John (inputing the Unix password) ; but I cannot write anything.
This is what I have in my smb.conf for the folder :
[gameserver] path = /home/locale/Documents/ valid users = John browsable = yes read only = no writeable = yes available = yes create mask = 0775 force user = John
I've seen plenty of people on the internet using 644 or 755 as a create mask - I don't want that. The directories set in locale/Documents are all set at 775, and I don't want to change that.
drwxrwxr-x 5 locale locale 4096 mars 3 09:19 . drwxr-xr-x 19 locale locale 4096 mars 3 09:27 .. drwxrwxr-x 19 locale locale 4096 mars 1 23:53 gameserver
John is of course part of the locale group. So I should not be a problem to write in the folder right ? After all, it works like that for my FTP.
What I should do ? I am really forced to go full on 777 on my folder in order to make this thing work ?
Thanks.
I have an Ubuntu server running a jellyfin server. I want to setup a synced folder with my main pc that runs windows so i don't have to use ssh or a usb every time i want to add content to my server.
I setup samba and successfully mapped the drive over my network. I can look at the files. but when i try to write to It I get "permission denied".
So my question is, how can I enable write privileges for samba?
for what it is worth, I couldn't access my samba share, maybe you have forgotten to add you username to the samba password group (for lack of beter description phrase)
this is what I did to get mine to work
smbpasswd -a username
after by using nautilus, shared my drive/folder with right-click, sharing, etc.
create your password, and use your username and passsword (which you just entered) to access your samba drive, you can also map this drive in Windows
hope this could help
Are the group and owner of the shared folder set properly for the samba user? Should be the same, or try
$ chown -R nobody:nogroup sharedfolder
for testing purposes...
You're missing:
force directory mode = 0777
Also, you really want to use 0666 for force create mask. Probably no good reason to force the execute bits.
Changing permissions to 777 ALWAYS makes me nervous, even if this is a home project. Instead, add all your samba users to a group (like samba_user), then in smb.conf add the line:
force group = samba_user
Naturally, you must also chgrp all the necessary folders as well. Then you can set finer grained permissions, allow people to do their thing in other people's folders, and your server isn't turned into a free for all. Someone wants to have a private folder? Just change that folder's group from samba_user back to the user's private group.