From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mathieu Lirzin Subject: Re: Samba user mounts Date: Mon, 15 Jan 2018 20:11:32 +0100 Message-ID: <87k1wjgcnv.fsf@gnu.org> References: <878td0wnlj.fsf@gnu.org> <87k1wkxurf.fsf@elephly.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43844) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebAAT-0004Xq-8S for help-guix@gnu.org; Mon, 15 Jan 2018 14:11:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebAAS-0004lw-4L for help-guix@gnu.org; Mon, 15 Jan 2018 14:11:37 -0500 In-Reply-To: <87k1wkxurf.fsf@elephly.net> (Ricardo Wurmus's message of "Sun, 14 Jan 2018 17:36:20 +0100") List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: Ricardo Wurmus Cc: help-guix@gnu.org Hello Ricardo, Ricardo Wurmus writes: >> I want to connect to my NAS using the Samba protocol. While I can use = =E2=80=98gvfs=E2=80=99 >> for that it is not convenient for me to access it from the command line = via >> the =E2=80=9C/run/user/1000/gvfs/smb-share:server=3Dnas,share=3Dhome/=E2= =80=9D filename. On my >> previous system I was able to add the following line in my =E2=80=9C/etc= /fstab=E2=80=9D file: >> >> //nas/home /mnt/mthl/nas-home cifs credentials=3D/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=3D1000,gid=3D1000,credentials=3D/etc/samba.credentials= ") > (mount-point "/nas") > (type "cifs") > (mount? #f) > (create-mount-point? #t)) > > And it does the right thing when I run =E2=80=9Cmount /nas=E2=80=9D. > > Does this help? Indeed this helps greatly. The only remaining minor issue is that the =E2=80=98mount=E2=80=99 command still needs to be run as root. I have adde= d the =E2=80=9Cuser=E2=80=9D option and turn =E2=80=98mount.cifs=E2=80=99 into a setuid program. (file-system (device "//192.168.1.100/home") (title 'device) (options "uid=3D1000,gid=3D1000,credentials=3D/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 suppo= rted. --8<---------------cut here---------------end--------------->8--- What happens I think is that =E2=80=98mount=E2=80=99 calls the =E2=80=98mou= nt.cifs=E2=80=99 from the store and not to the one in the =E2=80=9C/run/current-system/setuid-program= s=E2=80=9D directory. I don't know how this could be fixed. Thank you very much for this very helpful snippet. --=20 Mathieu Lirzin GPG: F2A3 8D7E EB2B 6640 5761 070D 0ADE E100 9460 4D37