On 14/06/18 18:39, RobH wrote:
> On 14/06/18 17:59, Dennis Lee Bieber wrote:
>> On Thu, 14 Jun 2018 15:59:29 +0100, RobH declaimed
>> the
>> following:
>>
>>> On 14/06/18 13:23, Dennis Lee Bieber wrote:
>>>> On Thu, 14 Jun 2018 12:04:01 +0100, RobH
>>>> declaimed the
>>>> following:
>>>>
>>>>> pi@raspberrypi:/mnt $ sudo chown -R 777 /mnt/CCTV
>>>>
>>>> Unless you have a user named "777" those parameters are wrong.
>>>> http://www.linfo.org/chown.html
>>>> """
>>>> The basic syntax for using chown to change owners is
>>>>
>>>> chown [options] new_owner object(s)
>>>> """
>>>>
>>>>
>>>>> drwxr-xr-x 3 777 root 4096 Jun 5 09:50 CCTV
>>>> ^^^ ^^^^
>>>>
>>>> ^^^ user name
>>>> ^^^^ group name
>>>>
>>>> Try
>>>>
>>>> chown -R pi /mnt/CCTV
>>>>
>>>> Or (untried) create a new group (call it NASuser), chown the mount
>>>> point to that group, and then add pi user to the new group.
>>>>
>>>>
>>>> That 777 looks like you are trying to set permission levels (the
>>>> rwx
>>>> stuff you see on the left). That command is chmod
>>>>
https://www.linode.com/docs/tools-reference/tools/modify-file-permissions-with-
chmod/
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>> I have changed 777 to 775.
>>>
>>> The reason I used it was because I didn't want any problems with no
>>> permissions either writing the file to my NAS box and viewing the file
>>> as a user
>>>
>>> chown -R pi /mnt/CCTV
>>> returns this:
>>>
>>> chown: changing ownership of '/mnt/CCTV/PiZero/dht.cpp': Operation not
>>> permitted
>>> chown: changing ownership of
>>> '/mnt/CCTV/PiZero/2018-06-14_10.12.34.h264': Operation not permitted
>>> chown: changing ownership of
>>> '/mnt/CCTV/PiZero/2018-050-23_17.m%.19.h264': Operation not permitted
>>>
>>> I used sudo chmod without any errors.
>>
>> If you had used "chmod" without "sudo" you'd have had the same error
>>
>> All "sudo" prefix does is say "execute the following command using
>> "root" privileges... I presumed you'd realize that changing ownership
>> would
>> require those elevated privileges and would use the sudo prefix; I merely
>> suggested the proper syntax for the "chown" part.
>>
>>>
>>> Using this eample, does the group have to be named, as in g= name of
>>> group??
>>>
>>> chmod -R +w,g=rw,o-rw, ~/group-project-files/
>>
>> Look at the output of "ls -l", it will tell you the owner, and the
>> group, that a file belongs to. If the user is a member of the group, it
>> will have the group privileges.
>>
>> What the above command did is: add write (modify) privilege --
likely
>> for the owner (who already had it), set group member access to
>> read/write,
>> and change "other" access to remove read/write (no access at all
>> unless the
>> files had eXecute privilege for "other".
>>
>> Even before you get a book on Linux basics, try to learn how to read
>> the result of
>>
>> man command-of-interest
>>
>> (though you may have to install the man pages; I don't recall if RPi
>> installs those by default)
>>
>>
>
> Ok, I'll have a look at that.
>
> Anyways, this is what I have tried so far
>
> pi@raspberrypi:~ $ chown -R pi /mnt
> pi@raspberrypi:~ $ chown -R pi /mnt/CCTV
> pi@raspberrypi:~ $ chown -R pi /mnt/CCTV/PiZero
>
> pi@raspberrypi:~ $ cd Downloads
> pi@raspberrypi:~/Downloads $ python intruder.py
> Traceback (most recent call last):
> File "intruder.py", line 37, in
> shutil.copyfile(RAMname, NASname)
> File "/usr/lib/python2.7/shutil.py", line 83, in copyfile
> with open(dst, 'wb') as fdst:
> IOError: [Errno 13] Permission denied:
> '/mnt/CCTV/PiZero/2018-06-14_17.35.31.h264'
>
> pi@raspberrypi:~ $ chown -R pi:pi /mnt/CCTV/PiZero
> chown: changing ownership of
> '/mnt/CCTV/PiZero/2018-06-14_17.35.31.h264': Operation not permitted
>
>
>
> pi@raspberrypi:~ $ sudo chmod -R pi=pi /mnt
> chmod: invalid mode: ‘pi=pi’
> Try 'chmod --help' for more information.
>
>
> I have been googling this permissions problem and have tried what you
> see from what others have said.
>
> The main problem I have is no matter what I try or do, the permissions
> do not change for the /mnt directory. This is owner and group of root.
>
> The other child folder permissons are owned by pi, and group pi, so
> unless I can get the permissions changed for /mnt, Ill never get my
> project finished.
>
The 0 byte files are being produced by the python script and have been
copied from the piZero over to my NAS box, and have 5 files from today's
efforts
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|