chown: Recursively change owner of all files and folders

Sometimes QNAP changes file owner to admin:administ (actually to admin:administratorsadmin user in administrators group) which may cause some troubles on certain FTP operations when you’re logged in to QNAP’s FTP server with user different than admin (using this user to operate on FTP is a quite great mistake and you should always use other, less privileged user for this).

Using chown command you can easily fix this.

General command pattern is:

chown [username]:[group] [filename]

For example:

chown guest:everyone temp.file
chown trejder:everyone temp.file
chown wife:family temp.file

You can use wildcards instead of filename:

chown wife:family *

Above will change file owner of every file in current directory to wife user and family group.

You can also use -R switch to change all files in current directory and recursively all files and folders in all folders below it:

chown -R trejder:everyone *

List of all current users and groups is in /etc/group file which you can list by calling:

more /etc/group

Similar list is also in QNAP’s Control Panel, in Privilege Settings > Users and Privilege Settings > User Groups.

Leave a Reply