| Linux | Security | Debian | Slax | Tiny Core | Health |
|
If a Computer Won't Start from a CD, DVD or USB Drive List the Contents of a Directory Mount an ISO Image Without Writing it to a CD or DVD |
LinuxFile OwnershipWhen using a Linux filesystem, every file and directory belongs to an owner and group. Files and directories created by users, normally belong to them. Operating system files and directories normally belong to root. SecurityHaving File Ownership and Permissions, increases the security of Linux operating systems. Files cannot be modified without appropriate permissions. Unauthorized access is more difficult. Linux is less likely to be affected by viruses and malware. When malware does affect Linux, it is less invasive. Change OwnerThere may be times when you want to change the owner of files or directories. For example, you may copy files from a USB drive using the root file manager, and they may belong to root. You may want to change this, so they belong to you. Root File ManagerWith most Linux distributions, the owner and group can be changed using the Root File Manager. To do this, right click on a file or directory. Click "Properties," then click "Permissions." Root TerminalFollowing is how to change owner and group using the Root Terminal. Find Out Owner and GroupTo find out the owner and group, open the terminal and type:
ls stands for list, and -l stands for long. Change Owner and GroupThe owner and group can be changed using the "chown" (change owner) command. You normally need to use the Root Terminal. chown options include:
The options within square brackets are optional. You must always include "chown," and you must always include the name of the file. You can use the name of the owner, or the group, or both. The group must be preceeded by a ":" to distinguish it from the owner. If you use a ":" not followed by a group name, it will be changed to the group of the user logged in. Some ExamplesIf you were in the directory /home/hilary/, and you wanted to change the owner of the file pictures/holiday/beach.jpg, to hilary, you could use:
Another option is to change to that directory, then change the owner.
For more information see Change Directory. If you wanted to change the owner to hilary, and the group to staff, you could use:
If Hilary was logged in, and she wanted to change the owner to hilary, and the group to her group, she could use:
The Recursive OptionThe recursive option enables you to change the owner of a directory, and all files and directories within that directory, with one command. To do this use "-R." For example, if you wanted to change the owner of the directory pictures, and all files and directories within pictures, to hilary, you could use:
More InformationFor more information and other options, open the terminal and type:
for the manual, or
for help. © Copyright Guy Shipard 2008 - 2009 |