Re: [Hampshire] Can't write to NAS

Top Page
Author: Hugo Mills
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] Can't write to NAS

Reply to this message
gpg: failed to create temporary file '/var/lib/lurker/.#lk0x56d35100.hantslug.org.uk.27809': Permission denied
gpg: keyblock resource '/var/lib/lurker/pubring.gpg': Permission denied
gpg: Signature made Sun Sep 20 12:45:26 2009 BST
gpg: using DSA key 20ACB3BE515C238D
gpg: Can't check signature: No public key
On Sun, Sep 20, 2009 at 11:14:19AM +0100, Rob Malpass wrote:
> Hi all
>
> I'm having a problem writing to one of my NAS devices with my Ubuntu
> box. Here's the setup:
>
> 2 PCs (one XP (marsh) and one Ubuntu (thomson))
> 2 NAS's (cnfs and cnfsusb).
>
> marsh (the XP box) can read and write to both NAS's.
> thomson can write to cnfs, but not to cnfsusb
>
> So one would think that it must be something to do with the
> permissions on cnfsusb - but the user I login as on XP is the same
> user I login as when I mount cnfsusb on thomson. I've set the
> permissions on the mount point such that any user can write to it -
> but when I mount it - these permissions are mysteriously reset back
> such that only root can write to it. Trouble is - even trying a
> simple
>
> sudo uname > /mnt/cnfsusb/fred


Note that this probably doesn't do what you think it does. The
redirect is applied by the shell that you're running in, so it's
writing the output of the sudo command (which is itself the output of
the uname command) as the user that executed the sudo command. What
you probably want is this:

sudo bash -c "uname >/mnt/cnfusb/fred"

In this case, the redirection is being done by the shell run from
inside sudo, and therefore is set up to write as the superuser.

> results in a permission denied. The mount command I'm using is
> exactly the same to mount cnfs as cnfsusb.


Hugo.

-- 
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 515C238D from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
   --- The English language has the mot juste for every occasion. ---