Re: [Hampshire] NAS permissions

Top Page

Reply to this message
Author: Simon Reap
Date:  
To: hampshire
Subject: Re: [Hampshire] NAS permissions
Have you added the rw,uid=fred,gid=fredgrp bit?

I've mounted a NAS disk on my machine with this in /etc/fstab:
//server1/disk /mnt/mydisk cifs
_netdev,nounix,rw,username=myuser,password=pass1,uid=me,gid=mygrp 0 0

(where my user name is "me" and its group is "mygrp")

An ls -ld /mnt/mydisk returns:
drwxr-xr-x 2 me mygrp 0 dec 30 15:54 /mnt/mydisk

(note the "me" and "mygrp" in the permissions).

The underlying /mnt/mydisk directory is owned by root:root, but that
doesn't show after the disk is mounted.

What does your mount command, or /etc/fstab line, look like now?

Simon

On 01/01/2014 18:14, Rob Malpass wrote:
>
> Hi
>
> Thanks -- using sudo tee did indeed work -- and I can create a
> subdirectory with
>
> sudo mkdir /mnt/abcd/foo
>
> Here are the permissions ls --l /mnt gives:
>
> drwxr-xr-x 14 root root    0 May 6  2003 wxyz

>
> drwxr-xr-x  1 root root    0 Jan  1 17:16 abcd

>
> and ls -l /mnt/abcd gives:
>
> drwxr-xr-x 0 root root    0 Dec 27 05:07 2013-14

>
> -rwxr-xr-x 0 root root 104 Jan 1 18:08 fred
>
> -rwxr-xr-x 0 root root 8922 Dec 26 19:15 hello2.odt
>
> drwxr-xr-x 0 root root    0 Oct 17 16:33 lost+found

>
> hello2.odt was created with windows and fred was created with the
> uname command above. However despite the mount point using the same
> user as the one windows created hello2.odt, Ubuntu cannot do anything
> without sudo at the start of the command.
>
> Cheers
>
> Rob
>
> *From:*hampshire-bounces@???
> [mailto:hampshire-bounces@mailman.lug.org.uk] *On Behalf Of *Michael
> Daffin
> *Sent:* 01 January 2014 18:00
> *To:* Hampshire LUG Discussion List
> *Subject:* Re: [Hampshire] NAS permissions
>
> Chris is correct, if you want to write a file as root you should pipe
> the output through 'sudo tee'
>
>     uname -a | sudo tee /mnt/abcd/xyz

>
> This invokes uname as the normal user, but pipes it to tee which is
> running as root, so writes to the file as root (it also prints the
> output to stdout as well, so can be redirected further if you wish).
>
> What are the current permissions of the mount and its contents? Can
> you write to a sub directory?
>
> On 1 January 2014 17:39, Chris Malton <chrism@???
> <mailto:chrism@cmalton.me.uk>> wrote:
>
> H Rob,
>
> On 01/01/14 17:31, Rob Malpass wrote:
>
>     sudo uname --a > /mnt/abcd/xyz

>
> uname -a will run as root, the output redirect runs as the invoking
> user. Therefore, it sounds like a Linux permissions issue over who
> owns the mountpoint. I need to understand this myself - so I'll let
> you know if I come up with anything.
>
> Regards,
>
> Chris
>
>
> --
> Please post to: Hampshire@???
> <mailto:Hampshire@mailman.lug.org.uk>
> Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
> LUG URL: http://www.hantslug.org.uk
> --------------------------------------------------------------
>
>
>
> --
> Michael Daffin <james1479@??? <mailto:james1479@gmail.com>>
>
> ------------------------------------------------------------------------
>
> No virus found in this message.
> Checked by AVG - www.avg.com <http://www.avg.com>
> Version: 2014.0.4259 / Virus Database: 3658/6963 - Release Date: 12/31/13
>
>
>


--
Please post to: Hampshire@???
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--------------------------------------------------------------