How To Change File or Directories On Linux 2

May 2, 2008 Linux Security | Comments (0) admin @ 8:50 am

2. Change by GroupLinux Directory

Use this permission file for Example (-rw-rw-r–) from this permission it mean :
File owner can read and write can not to execute.
User in owner group can read and write, but can not to execute.
Other user out of this group can read only.

About File permission
- r can read.
- w can write.
- x can execute.

Group of person
- u file owner.
- g user in group of file owner.
- o other user out of group file owner.
- a all 3 groups

For this Example will use + and – for add and delete permission.

Exam : If you want to change all users and groups can execute this file (yourfile.txt) you need to use command as below :

#chmod a+x yourfile.txt

Exam : If you want to set owner and group can execute this file use the command :

#chmod ug+x yourfile.txt

Options for chmod command
- c you can see result after use this command on display.
- R use this option for change permission to all subdirectory or all files in subdirectory.

How To Change File or Directory Permission On Linux

Linux Security | Comments (0) admin @ 8:45 am

1. Use Binary Number

Use this permission file for Example (-rw-rw-r–) from this permission it mean :Linux Command
- First character (-) mean this is Regular File.
- Next 3 character (rw-) mean Owner of this file, in this file permission owner can read and write, but can’t to execute this file.
- Next 3 character (rw-) mean User in owner group they can read and write, but can’t to execute this file.
- Last 3 character (r–) mean for other user they can read only on this file.

File Permission
- Read Permission (r)
- Write Permission (w)
- Execute Permission (x)

How to change permission
Example : (-rw-rw-r–)
1. Change this character to binary number. If it have character replace it by 1, if it have “-” character replace it by 0.
2. Change binary number from first step to decimal number.
3. Can use decimal number for change the permission of your file or directory.

Read More…