I’m only trying to write to a samba server in the simplest way possible
Anyway, adding that line still does not change anything. Perhaps it is server side, it’s a Synology () NAS, and I can write as the specified user to those drives, via the webui. Anyway, this is what the folders look like, they are owned by root all the way:
[freek@deneb:/mnt/arcturus]$ ll
total 0
drwxr-xr-x 2 root users 0 20 dec 13:50 compute
drwxr-xr-x 2 root users 0 5 feb 11:40 incoming_data
drwxr-xr-x 2 root users 0 5 feb 12:28 qodon
I was able to mount a samba share on the command line, but was not able to get this in Dolphin on KDE, using nixs 24.11
For my build, I needed to update lib.getBin to pkgs.lib.getBin to get this to build on 24.11
I still cannot “browse” through Dolphin, but I typed in the direct smb://x.x.x.x/folder-name and that then prompted me for username and password. I can browse, but I cannot open files. Dr. Konqi keeps crashing with little information, but in the logs I think there is something up with .kioworker-wrapper. Not sure how to fix this.
I didn’t have these issues when using nixos 24.05 kde with xwayland.
It still does not work for me having tried all solutions in this thread.
I can write when I am root, using the same samba credentials so it is not a server issues then I guess.
The mount point continue to be root owned, even when I umount, then chmod the mountpoint to my user, after remouting they are again root owned. Perhaps that is a clue?
in ["${automount_opts},credentials=/etc/nixos/smb-secrets,uid=${toString config.users.users.freek.uid},gid=${toString config.users.groups.users.gid}"];
When I hardcode the uid like this:
in ["${automount_opts},credentials=/etc/nixos/smb-secrets,uid=1000,gid=${toString config.users.groups.users.gid}"];
Not sure what the mistake was, but, it does work!!!
Sorry to revive this but this thread was extremely helpful to partially solve my issue and hoping one of you can help get me past what I hope is the last hump
When attempting to mount without sudo, mount /mnt/unraid2/ngt, I’m getting this error
Unable to set current process capabilities: Operation not permitted
error 2 (No such file or directory) opening credential file /etc/nixos/smb-secrets-unraid
The path to the credentials file is correct and my user definitely has read permissions on it. If I sudo that mount command it works. So I’m at a loss as to why this won’t work.
Hmm I’d try the following: Create a simple bash script that will do something like cat | head -1 for this smb-secrets-unraid file. Then, give that bash script exactly the same permissions, owner/group and setuid etc permission, just like the mount.cifs wrapper generated by Nixpkgs. Then see if you are really capable of reading that file.
Just learned you can put the creds directly in the options. I don’t like it, but it works for now. Also proves to me that the problem is just permissions on the creds file even though it shouldn’t be
Indeed not ideal. This is a security concern. Also, if one day you’d succeed with the secrets fail approach, I’d make that file readable only for people in a certain group, and put your user in that group.
I slightly suspect what you are experiencing is an upstream bug - worth discussing with them. Maybe there is a bug when the mount.cifs executable has suid bits, it fails. Also, I am wondering whether running the following as your user would fail too:
That is how I initially set it up, ended up making a user on my NAS specifically for the script I didn’t want running sudo, the impetus for all this, to at least limit risk.