• HOME
  • TECH BLOG
  • MIGRATING TO AMAZON WEB SERVICES
  • IT PROJECT MANAGEMENT BLOG
  • Q&A
  • INTERACTIVE LEARNING
Pop-up Preset:








FILE PERMISSIONS



​



file permissions



three types



There are three major types of file permissions:

User permissions. These permissions apply to a single user who has special access to a file.


This user is called the owner. 



Group permissions. These apply to a single group of users who have access to a file.

This group is the owning group.



Other permissions. These apply to every other user on the system.


These users are known as others.


When a file is created, its owne

r is the user who created it, and the owning group is the user's current group.

4 STANDS FOR "READ"

2 STANDS FOR "WRITE"

1 STANDS FOR "EXECUTE"

0 STANDS FOR "NO PERMISSION'

7 would give "READ", "WRITE" and "EXECUTE" permissions.

6 would give "READ" and "WRITE" permissions.

5 would give "READ" and "EXECUTE" permissions.

4 would give "READ" only permissions.


Only root can change the owner of a file.

The owner cannot transfer ownership, unless the owner is root, or uses sudo to run the command.



CHMOD



CHANGES MODE



The chmod command stands for "change mode".

It changes the permissions to files and folders,.

CHMOD is also known as "modes" in Linux


chmod 754 myfile

The file called myfile has been changes with the permissions below:


7 - "READ", "WRITE" and "EXECUTE" permissions for the OWNER

5 - "READ" and "EXECUTE" permissions for the GROUP

4 - "READ" only permissions for OTHER



chown



changes ownership



Generally, the user who creates a file is usually the owner of that file. The owner however can transfer ownership of the file with the chown command.

Example 1

chown paul test

Grants ownership :

1.) To the user named paul.

2.) For a file called test.


Example 2

sudo chown -R paul: superuser otherfiles

Changes ownership for both:


1.) To the user named paul.

2.) To the group named superusers

3.) For the directory called otherfiles

4.) It also gives access to any files and subdirectories located within the directory otherfiles.


The -R option is what applies the rights for all files inside of the directory



more

CHMOD VS CHOWN
WHICH ONE TO USE ?



AWS Server Migration Service




CHOWN deals with the WHO.


1.) WHO owns the file


CHOWN changes WHO owns the file and the group it belongs to


A.) The user - who is the user

B.) The group - who is the group


CHMOD deals with the WHAT


2.) WHAT can they do with the file


CHMOD changes how the USER and GROUP can access the file

or if they can access the file it at all.



more

CERTIFIED CLOUD EXPERTS | AWS PARTNER NETWORK
CLOUD CONSULTING FIRM | (516) 387-2085 | CONTACT US