HIT computer system security Chapter III Homework

1, when you run the binary and script files, how to set permissions?
Binary files, you need to execute permissions.
Script file, you need to read and execute permissions

2. What is the purpose of performing a bit directory?
Execute bit directory node can traverse the index file, find the file
has the execute bit directory, to operate the file or directory

3, read /home/abc/aaa.txt file the required permissions? Delete /home/abc/aaa.txt need any permission?
Read /home/abc/aaa.txt file

删除/home/abc:
目录  /   /home  /abc  具有读和执行权限

Abc has write access to the directory

4, with a fork to create a process, and the process exec with the implementation of the document, what difference its euid, suid, ruid respectively?
Fork euid process created, the child process and the parent process, suid, ruid same
exec execute the setuid bit program, euid as root, ruid is logged-on user id, suid 0 or login user id

5, meaning a function setuid different results under different operating system versions and different situations, how to avoid ambiguity?
Setuid function in different operating systems, different versions of different meanings.
Use seteuid, setreuid, setresuid function, meaning clear.

Wrapper function may be used drop_priv_temp, drop_priv_perm, restore_priv like. Own package or function.
Do not use setuid function, which is ambiguous, and after use euid envisaged different, cause the program to run at a high privilege.

6, file permissions, directory set
to read the file, you need to read the file permissions to read and execute permissions layers directory.
Execute permission to run an executable file, you need to file, layers directory read and execute permissions.
Script file, you need to read and execute permissions to run.

Hard-wired, deletion, need to find the file inode pointer, pointers in the inode number of links to be modified, when the number of connections is greater than the hard-1 can not delete the file. Hard to 1 when the number of connections to delete the file.

  1. write the file /d1/d2/f3
    x on / and /d1 and /d2, w on f3
  2. delete the file /d1/d2/f3
    x and w on /d1/d2, x on / and /d1
  3. execute the file /d1/d2/f3, which is a binary file
    x on f3 and / and /d1 and /d1/d2,
  4. execute the file /d1/d2/f3, which is a shell script
    r and x on f3, x on / and /d1 and /d2
  5. list the file names under the directory /d1/d2s
    x on / and /d1 , r on /d2s
  6. delete the directory /d1/d2, where the directory is empty
    x on / and /d1, w on /d1
  7. delete the directory /d1/d2, where /d1/d2 contains one file /d1/d2/f3
    x on / and /d1, w on /d1, w and x on /d2
  8. delete the directory /d1/d2, where /d1/d2 contains a subdirectory /d1/d2/d3, which contains one file /d1/d2/d3/f4
    x on / , w and x on /d1, w and x on /d1/d2, w and x on /d1/d2/d3
  9. create the directory /d1/d2/d3, when /d1/d2 exists, and /d1/d2/d3 does not
    x on / and /d1, x and w and r on /d1/d2
  10. rename a file from / d1 / d2 / f3 to / d1 / d2 / f4
    change the file name, folder required permissions w
    x on / and / d1, w and x on / d2
  11. Create A Hard Link / D1 / D2 / F3, Which Points to / D4 / F5
    / D2 folder has write permission, f5 have write permission
    X ON / and / D1, X and W ON / D2,
    R & lt and X ON / d4, w on f5
  12. remove / d1 / d2 / f3, which is a hard link pointing to / d4 / f5
    Answer: / d2 have wx permissions, f5 w permission is
    x on / and / d1, w and x on / d1 / d2, directory d2 have write and execute permissions
    r and x on / d4, w on f5 to have write permissions to modify the number of connections
  13. Create A symbolic Link / D1 / d2 / F3, Which Points to The Directory / D4
    Symbolic Link symbolic link
    Answer: directory d2 have wx permissions, f3 have rx permission
    x on / and / d1 and / d2, w on / d2, rx F3 ON
    14 The File Read / D1 / D2 / F3 / F5, WHERE / D1 / D2 / F3 pointing to IS A symbolic The Link Directory / D4, and / A File the contains D4 / D4 / F5. Reading file / d1 / d2 / f3 / f5 , / d1 / d2 / f3 is a symbolic link execution to the directory / d4, under / d4 directory contains files d5
    answer: the symbolic link file f3 have rx permissions, / d4 have x permission, f5 there r permission to
    the X-ON / and / d1 and / D2
    rx ON F3, rx ON / D4, r ON F5
    15 the Delete at The File / d1 / D2 / F3 / F5, in at The Same, Setting AS above
    answer:
    the X-ON / and / d1 and / d1 / d2 and / d4, w on f3 and / d4
Released seven original articles · won praise 3 · Views 468

Guess you like

Origin blog.csdn.net/qq_39600733/article/details/104056723