Re: [Hampshire] NAS permissions

Top Page

Reply to this message
Author: Rob Malpass
Date:  
To: 'Hampshire LUG Discussion List'
Subject: Re: [Hampshire] NAS permissions
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@???> 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@???
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--------------------------------------------------------------







--
Michael Daffin <james1479@???>

_____

No virus found in this message.
Checked by AVG - 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
--------------------------------------------------------------