* Samba user mounts
@ 2018-01-14 13:56 Mathieu Lirzin
2018-01-14 16:36 ` Ricardo Wurmus
0 siblings, 1 reply; 3+ messages in thread
From: Mathieu Lirzin @ 2018-01-14 13:56 UTC (permalink / raw)
To: help-guix
Hello,
I want to connect to my NAS using the Samba protocol. While I can use ‘gvfs’
for that it is not convenient for me to access it from the command line via
the “/run/user/1000/gvfs/smb-share:server=nas,share=home/” filename. On my
previous system I was able to add the following line in my “/etc/fstab” file:
//nas/home /mnt/mthl/nas-home cifs credentials=/home/mthl/.smbfile,rw,noauto,user 0 0
which allowed me to execute the following command as a regular user:
$ mount /mnt/mthl/nas-home
Does anybody know how to achieve similar thing on GuixSD?
Thanks.
--
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761 070D 0ADE E100 9460 4D37
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Samba user mounts
2018-01-14 13:56 Samba user mounts Mathieu Lirzin
@ 2018-01-14 16:36 ` Ricardo Wurmus
2018-01-15 19:11 ` Mathieu Lirzin
0 siblings, 1 reply; 3+ messages in thread
From: Ricardo Wurmus @ 2018-01-14 16:36 UTC (permalink / raw)
To: Mathieu Lirzin; +Cc: help-guix
Hi Mathieu,
> I want to connect to my NAS using the Samba protocol. While I can use ‘gvfs’
> for that it is not convenient for me to access it from the command line via
> the “/run/user/1000/gvfs/smb-share:server=nas,share=home/” filename. On my
> previous system I was able to add the following line in my “/etc/fstab” file:
>
> //nas/home /mnt/mthl/nas-home cifs credentials=/home/mthl/.smbfile,rw,noauto,user 0 0
>
> which allowed me to execute the following command as a regular user:
>
> $ mount /mnt/mthl/nas-home
>
> Does anybody know how to achieve similar thing on GuixSD?
I have this in my config:
(file-system
(device "//my.nas/the-share")
(title 'device)
(options "uid=1000,gid=1000,credentials=/etc/samba.credentials")
(mount-point "/nas")
(type "cifs")
(mount? #f)
(create-mount-point? #t))
And it does the right thing when I run “mount /nas”.
Does this help?
--
Ricardo
GPG: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC
https://elephly.net
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Samba user mounts
2018-01-14 16:36 ` Ricardo Wurmus
@ 2018-01-15 19:11 ` Mathieu Lirzin
0 siblings, 0 replies; 3+ messages in thread
From: Mathieu Lirzin @ 2018-01-15 19:11 UTC (permalink / raw)
To: Ricardo Wurmus; +Cc: help-guix
Hello Ricardo,
Ricardo Wurmus <rekado@elephly.net> writes:
>> I want to connect to my NAS using the Samba protocol. While I can use ‘gvfs’
>> for that it is not convenient for me to access it from the command line via
>> the “/run/user/1000/gvfs/smb-share:server=nas,share=home/” filename. On my
>> previous system I was able to add the following line in my “/etc/fstab” file:
>>
>> //nas/home /mnt/mthl/nas-home cifs credentials=/home/mthl/.smbfile,rw,noauto,user 0 0
>>
>> which allowed me to execute the following command as a regular user:
>>
>> $ mount /mnt/mthl/nas-home
>>
>> Does anybody know how to achieve similar thing on GuixSD?
>
> I have this in my config:
>
> (file-system
> (device "//my.nas/the-share")
> (title 'device)
> (options "uid=1000,gid=1000,credentials=/etc/samba.credentials")
> (mount-point "/nas")
> (type "cifs")
> (mount? #f)
> (create-mount-point? #t))
>
> And it does the right thing when I run “mount /nas”.
>
> Does this help?
Indeed this helps greatly. The only remaining minor issue is that the
‘mount’ command still needs to be run as root. I have added the “user”
option and turn ‘mount.cifs’ into a setuid program.
(file-system
(device "//192.168.1.100/home")
(title 'device)
(options "uid=1000,gid=1000,credentials=/home/mthl/.smbfile,user")
(mount-point "/mnt/nas-home")
(type "cifs")
(mount? #f)
(create-mount-point? #t))
(setuid-programs (cons (file-append cifs-utils "/sbin/mount.cifs")
%setuid-programs))
However I am still unable to mount this as a regular user:
--8<---------------cut here---------------start------------->8---
$ mount /mnt/nas-home
This program is not installed setuid root - "user" CIFS mounts not supported.
--8<---------------cut here---------------end--------------->8---
What happens I think is that ‘mount’ calls the ‘mount.cifs’ from the
store and not to the one in the “/run/current-system/setuid-programs”
directory. I don't know how this could be fixed.
Thank you very much for this very helpful snippet.
--
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761 070D 0ADE E100 9460 4D37
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-01-15 19:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-14 13:56 Samba user mounts Mathieu Lirzin
2018-01-14 16:36 ` Ricardo Wurmus
2018-01-15 19:11 ` Mathieu Lirzin
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.