Changing File Owner and Permissions

Questions about SNMP, Power, System, Logs, disk, & RAID.

Changing File Owner and Permissions

Postby .:Plasma:. » Sun Jul 22, 2012 5:48 am

Ok so Today I came across a problem completely of my own making.

While creating the folders for media on my NAS it seems I may have mucked up the permissions.

I have a folder that is owned by me but the contents are all owned by admin so I have no write access.

I'd like an easy way to fix this which I figured I could do with the web file manager, but the "Properties" only allows me to set "read", "read/write" etc against Owner, Group and Public. However it won't actually let me change the Owner or the Group etc!

Is is simply a case of SSH in to the NAS and set them manually with chmod / chown etc? Don't want to bugger it all up now I have it working almost right.

As a side note I'm surprised you can't set the Owner and Group from anywhere in the Admin Interface, unless you can and I haven't found it yet.

Plasma
QNAP TS-459P+ w/ 2 * Seagate Barracuda 3TB 7200rpm (RAID1) - FW: 3.8.0
.:Plasma:.
Getting the hang of things
 
Posts: 74
Joined: Sat Jun 25, 2011 5:47 am
NAS Model: TS-259 Pro

Re: Changing File Owner and Permissions

Postby pwilson » Sun Jul 22, 2012 6:09 am

Plasma wrote:Ok so Today I came across a problem completely of my own making.

While creating the folders for media on my NAS it seems I may have mucked up the permissions.

I have a folder that is owned by me but the contents are all owned by admin so I have no write access.

I'd like an easy way to fix this which I figured I could do with the web file manager, but the "Properties" only allows me to set "read", "read/write" etc against Owner, Group and Public. However it won't actually let me change the Owner or the Group etc!

Is is simply a case of SSH in to the NAS and set them manually with chmod / chown etc? Don't want to bugger it all up now I have it working almost right.

As a side note I'm surprised you can't set the Owner and Group from anywhere in the Admin Interface, unless you can and I haven't found it yet.

Plasma


SSH into your NAS (using "admin" credentials) and ....

Note: Use "Cut&Paste" to ensure you copy this accurately :twisted:
Code: Select all
cd /share/MD0_DATA/Multimedia/plasma
/bin/chown -R plasma.everyone * .[a-z]* .
exit


The "chown" command above will change ownership to: owner:plasma, group:everyone, for all files, (including those beginning with a period followed by a lowercase letter), recursively. (The last period changes the ownership on the present directory itself as well).

Note1: You need to use the ".[a-z]*" construct to prevent it from changing the ownership on "..", which is why you can't simply use ".*" for that second filename
Note2: Due to QNAP's insistence on using Busybox v1.01, it prevents using the "-v" switch with "chown", as this switch is not supported in Busybox v1.01

Once you actually own the files again you should be able to change the permissions via WFM (Web File Manager) again, as you again own them.

Hope this helps...

Patrick
Last edited by pwilson on Sun Jul 22, 2012 10:00 am, edited 10 times in total.

Patrick M. Wilson
Victoria, BC Canada
QNAP TS-419P+ w/ 4 * Seagate Barracuda 2TB 5900rpm (RAID5) - FW: QTS 4.0.1 Build0606
Forums: View My Profile - Search My Posts - Send Private Message - View My Photo - Top Community Forum Posters
QNAP: Turbo NAS User Manual - QNAP Wiki - QNAP Tutorials - QNAP FAQs - HowTos - QNAP Video Library
User avatar
pwilson
Moderator
 
Posts: 4307
Joined: Fri Mar 06, 2009 11:20 am
Location: Victoria, BC, Canada
NAS Model: TS-419P+

Re: Changing File Owner and Permissions

Postby .:Plasma:. » Sun Jul 22, 2012 6:43 am

Magic I'll give that a whirl, thanks for the quick reply.

Plasma
QNAP TS-459P+ w/ 2 * Seagate Barracuda 3TB 7200rpm (RAID1) - FW: 3.8.0
.:Plasma:.
Getting the hang of things
 
Posts: 74
Joined: Sat Jun 25, 2011 5:47 am
NAS Model: TS-259 Pro


Return to System & Disk Volume Management

Who is online

Users browsing this forum: jon539, Oros and 5 guests