User brian changes the permissions for db_data this command:
chmod 4755 db_data
What is true?
A.
db_data now has permissions rwsr-xr-x and can be deleted only by user brian.
B.
db_data now has permissions rwsr-xr-x and, if executed, will inn with the permissions of user
brian.
C.
db_data now has permissions rwxr-sr-x and can be deleted only by members of the group
owning it.
D.
The permissions for db_data cannot be determined, because the permissions prior to the
change have not been specified.
E.
db_data must be an ordinary file, because special permissions cannot be set on a directory.
Explanation:
Use the chmod command to change permissions for a file or directory. You must be
the owner of a file or directory, or have root access, to change its permissions.
Here we do not know if brian owns db_data.Note:
Permission
7 full
6 read and write
5 read and execute
4 read only
3 write and execute
2 write only
1 execute only
0 none
0 — no permission
1 –x execute
2 -w- write
3 -wx write and execute
4 r– read
5 r-x read and execute
6 rw- read and write
7 rwx read, write and execut
Solaris: Solaris Advanced User’s Guide
B
i go with B one.
B
man chmod
n
a number from 0 to 7. An absolute mode is constructed
from the OR of any of the following modes:
4000
Set user ID on execution.
A I tested
ronin@Solaris:~/test$ chmod 4755 test_file
ronin@Solaris:~/test$ ls -lash
total 21
3 drwxr-xr-x 3 ronin staff 11 Jan 5 12:59 .
5 drwxr-xr-x 26 ronin staff 43 Dec 18 10:30 ..
3 -rwsr-xr-x 1 ronin staff 541 Nov 30 21:10 File
1 -rw-r–r– 1 ronin staff 0 Nov 30 11:19 filea
1 -rw-r–r– 1 ronin staff 0 Nov 30 11:20 Filea
1 -rw-r–r– 1 ronin staff 0 Nov 30 11:19 fileb
1 -rw-r–r– 1 ronin staff 0 Nov 30 11:20 Fileb
1 -rw-r–r– 1 ronin staff 0 Nov 30 11:19 filec
1 -rw-r–r– 1 ronin staff 0 Nov 30 11:20 Filec
1 -rwsr-xr-x 1 ronin staff 0 Jan 5 12:59 test_file
3 drwxr-xr-x 3 ronin staff 9 Dec 17 16:26 test2
ronin@Solaris:~/test$ su arado
Password:
arado@Solaris:~/test$ ls -la
total 21
drwxr-xr-x 3 ronin staff 11 Jan 5 12:59 .
drwxr-xr-x 26 ronin staff 43 Dec 18 10:30 ..
-rwsr-xr-x 1 ronin staff 541 Nov 30 21:10 File
-rw-r–r– 1 ronin staff 0 Nov 30 11:19 filea
-rw-r–r– 1 ronin staff 0 Nov 30 11:20 Filea
-rw-r–r– 1 ronin staff 0 Nov 30 11:19 fileb
-rw-r–r– 1 ronin staff 0 Nov 30 11:20 Fileb
-rw-r–r– 1 ronin staff 0 Nov 30 11:19 filec
-rw-r–r– 1 ronin staff 0 Nov 30 11:20 Filec
-rwsr-xr-x 1 ronin staff 0 Jan 5 12:59 test_file
drwxr-xr-x 3 ronin staff 9 Dec 17 16:26 test2
arado@Solaris:~/test$ rm test_file
rm: test_file: override protection 755 (yes/no)? y
rm: test_file not removed: Permission denied
arado@Solaris:~/test$