1) Create a new file, test. QA: What are the group, owner, and other permissions
ID: 3790205 • Letter: 1
Question
1) Create a new file, test.
QA: What are the group, owner, and other permissions
QB: What is the owner:group configuration
2) Create a new file using sudo, sudo_test
QC: What are the group, owner, and other permissions
QD: Note the owner:group configuration
3) Use the sudo chown command to make the owner your account and the group root on the files
QE: what is the exact command you used?
QF: can you write to both files?
QG: can you read both files?
4) Use the sudo chmod command to alter both files so that the owner can read but not write and the group can read & write.
5) create a new group, test_group
6) add your user to the group, test_group
QH: can you write to both files still?
QI: can you read from both files still?
Explanation / Answer
1) touch test
QA: By default read, write permission for owner and group whereas for others only read permission is there.
QB: While creating a file by default the person creating the file is the owner and group as well with both having read, write configurations.
2) sudo touch sudo_test
QC: owner has both read and write permission while group and others will have only read permission.
QD: Since the file is created by only root permission hence the owner:group configuration will be root:root i.e. the owner and group of this file is by default root.
3)
QE: sudo chown surabhi test test1
sudo chgrp root test test1
QF: Yes. Any user can read both files.
QG: Since I am the owner of both file So I can write into both files.
4) sudo chmod u=r test test1 or sudo chown u-w test test1
sudo chmod g=rw test test1
We use equal when the existing file has more permission and you want to assign less. For example the test file had both read and write permission and now I have to assign only read so one way is to use = and other way is to use - (use minus when u are already aware of the file permissions)
5) sudo groupadd test_group
6) QH: Since I dont have write permission to the files, I cant write to files.
QI: Yes I can read both the files.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.