all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mathieu Lirzin <mthl@gnu.org>
To: Ricardo Wurmus <rekado@elephly.net>
Cc: help-guix@gnu.org
Subject: Re: Samba user mounts
Date: Mon, 15 Jan 2018 20:11:32 +0100	[thread overview]
Message-ID: <87k1wjgcnv.fsf@gnu.org> (raw)
In-Reply-To: <87k1wkxurf.fsf@elephly.net> (Ricardo Wurmus's message of "Sun, 14 Jan 2018 17:36:20 +0100")

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

      reply	other threads:[~2018-01-15 19:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-14 13:56 Samba user mounts Mathieu Lirzin
2018-01-14 16:36 ` Ricardo Wurmus
2018-01-15 19:11   ` Mathieu Lirzin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k1wjgcnv.fsf@gnu.org \
    --to=mthl@gnu.org \
    --cc=help-guix@gnu.org \
    --cc=rekado@elephly.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.