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"
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...
debian - Can't make samba share writable - Unix & Linux Stack Exchange
Can't write to samba share on Windows 11 despite changing the samba config
Can't get write permission on a synology SAMBA share from my debian server
permissions - Samba (Cannot Write) issue - Stack Overflow
Videos
Greetings all,
I am fairly new to this, so please accept my apologies in advance :P
So I have debian12 running in a VM (proxmox), I have several apps running like heimdal, immish, emby... that sort of things.
I am trying to install manyfold, but the container apparently needs read permissions, except my files are stored on a synology nas (samba share).
root has access, no problem, but when I switch to my normal user, indeed, I can't write in those folders.
This is my FSTAB : as you can see I have several folders mounted, but I can't write in any of them. There is read/write permissions for the user "batuu" on my synology nas. I tried to mount 3Dfiles with 2 different lines, but no dice so far.
Halp !
startide@halcyon:/media/share$ nano /etc/fstab GNU nano 7.2 /etc/fstab # /etc/fstab: static file system information. # # Use 'blkid' to print the universally unique identifier for a # device; this may be used with UUID= as a more robust way to name devices # that works even if disks are added and removed. See fstab(5). # # systemd generates mount units based on this file, see systemd.mount(5). # Please run 'systemctl daemon-reload' after making changes here. # # <file system> <mount point> <type> <options> <dump> <pass> # / was on /dev/sda1 during installation UUID=5cc0304f-07ea-4b83-bc7e-298a7cd6b190 / ext4 errors=remount-ro 0 1 # swap was on /dev/sda5 during installation UUID=0b652e05-ecff-4e01-b28c-1f0191ee7100 none swap sw 0 0 /dev/sr0 /media/cdrom0 udf,iso9660 user,noauto 0 0 #network share for emby //192.168.1.25/movies /media/share/movies cifs username=batuu,password=redacted 0 0 //192.168.1.25/series /media/share/series cifs username=batuu,password=redacted 0 0 #network share for himlish //192.168.1.25/photos /media/share/photos cifs username=batuu,password=redacted 0 0 #network share for manyfold # //192.168.1.25/3Dfiles /media/share/3Dfiles cifs uid=1000,gid=1000,username=batuu,password=redacted,uid=1000,gid=1000 0 0 //192.168.1.25/3Dfiles /media/share/3Dfiles cifs guest,uid=1000,username=batuu,password=redacted,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm 0 0
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.
Basically I have 4 hard drives that I have mounted in a USB dock that's connected to my Proxmox box and passed through to Ubuntu server. For some reason when I mounted the drive, I can see it but it refuses to let me write to it.
I'm open to other ideas if there's something better. Not looking to use TrueNAS or anything else like that due to the fact that it cannot see all 4 of the drives from that stack. Ideally I'd stick with Ubuntu server. I have considered SFTP, but was hoping to get samba shares up for simplicity so my SO can use it without frustration.
Here's what I have setup so far after reading a handful of different stack overflow suggestions, none of them worked.
I recommend to create a dedicated user for that share and specify it in force user(see docs).
Create a user (shareuser for example) and set the owner of everything in the share folder to that user:
adduser --system shareuser
chown -R shareuser /path/to/share
Then add force user and permission mask settings in smb.conf:
[myshare]
path = /path/to/share
writeable = yes
browseable = yes
public = yes
create mask = 0644
directory mask = 0755
force user = shareuser
Note that guest ok is a synonym for public.
In the share settings in smb.conf, you'll need to specify the names of users and/or groups that are allowed to write to the share, using a write list = ... line.
Example:
[myshare]
...
write list = my_linux_username
Then you'll need to use the smbpasswd command to set up a password to authenticate my_linux_username for Samba:
sudo smbpasswd -a my_linux_username
This step is necessary because the standard system passwords in /etc/shadow are hashed in algorithms that are incompatible with the password hash algorithms used in the SMB protocol. When a client sends a SMB authentication packet, it includes a hashed password. It can only be compared to another password hash that uses the same algorithm.
(Very, very old instructions from the previous millennium may recommend disabling password encryption in Samba, and using certain registry hacks to allow Windows to emit unencrypted passwords to the network. This advice is obsolete: those registry hacks may no longer work in current versions of Windows, and allow anyone who can monitor your network traffic to trivially capture your password.)
There's one more thing you may have to do client-side. When your Windows client system is joined to an Active Directory domain and you're logged in with an AD account, it automatically prefixes all unqualified usernames with the name of the AD domain of the user, i.e. you will be authenticating as AD_DOMAIN\your_username, not just your_username.
If you are logged in with a local account (or your client system is not joined to an AD domain), Windows may automatically prefix the username with the client hostname unless you specify another domain name.
To successfully log in to a stand-alone Samba server from a stand-alone Windows client, you may have to specify your username as SAMBA_SERVER_HOSTNAME\your_username.
Otherwise Samba will see the username as WINDOWS_CLIENT_HOSTNAME\your_username, conclude that it has no way to verify any users belonging to domain named WINDOWS_CLIENT_HOSTNAME, and will reject the login.
(Newer versions of Samba may have a built-in check for this specific situation, and they might allow you access nevertheless. But this is basically how SMB authentication works "under the hood", and if you need to deal with old versions of Samba, it might be useful still.)
I setup a Samba shared folder and I can access it through my other linux laptop (manjaro) but I can't write any changes to it. I get a Permission Denied message.
samba config file
Also I did steps 2/3 from this site to make samba work on Fedora 31.
Anyone know how can I make my shared folder writeable by other users mainly my other linux machine (manjaro)?
Thanks