Operating Systems 2017F: Assignment 4: Difference between revisions

From Soma-notes
 
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''This assignment is not yet finalized.'''
These questions refer to the code from [[Operating Systems 2017F: Tutorial 7|Tutorial 7]] and [[Operating Systems 2017F: Tutorial 8|Tutorial 8]].


==Full Questions==
==Full Questions==
Line 22: Line 22:
<ol style="list-style-type:lower-alpha">
<ol style="list-style-type:lower-alpha">
<li> /etc/passwd
<li> /etc/passwd
<li> ~/.ssh/authorized_keys
<li> '''~/.ssh/authorized_keys'''
<li> ~/.ssh/known_hosts
<li> ~/.ssh/known_hosts
<li> ~/.ssh/id_rsa.pub
<li> ~/.ssh/id_rsa.pub
Line 33: Line 33:
<li> ~/.ssh/known_hosts
<li> ~/.ssh/known_hosts
<li> ~/.ssh/id_rsa.pub
<li> ~/.ssh/id_rsa.pub
<li> ~/.ssh/id_rsa
<li> '''~/.ssh/id_rsa'''
</ol>
</ol>
<li> How do sshfs inode values relate to the inodes in the remotely mounted filesystem?
<li> How do sshfs inode values relate to the inodes in the remotely mounted filesystem?
<ol style="list-style-type:lower-alpha">
<ol style="list-style-type:lower-alpha">
<li> The sshfs inode values are identical to those on the remote filesystem.
<li> The sshfs inode values are identical to those on the remote filesystem.
<li> The sshfs inode values have no relationship to the remote filesystem inode values.
<li> '''The sshfs inode values have no relationship to the remote filesystem inode values.'''
<li> The sshfs inode values are the remote inode numbers plus a fixed offset.
<li> The sshfs inode values are the remote inode numbers plus a fixed offset.
<li> The sshfs inode values are sometimes the same as the remote inode values, and sometimes they are different.
<li> The sshfs inode values are sometimes the same as the remote inode values, and sometimes they are different.
Line 46: Line 46:
<li>Line 14, <tt>self.ino += 1</tt>
<li>Line 14, <tt>self.ino += 1</tt>
<li>Line 18, <tt>self.ino = 1</tt>
<li>Line 18, <tt>self.ino = 1</tt>
<li>Both Line 14 and 18
<li>'''Both Line 14 and 18'''
<li>None of the above
<li>None of the above
</ol>
</ol>
<li> In sshfs, do a file's uid and gid values come from the remote server or from the mounting user's uid and gid?
<li> In sshfs, do a file's uid and gid values come from the remote server or from the mounting user's uid and gid?
<ol style="list-style-type:lower-alpha">
<ol style="list-style-type:lower-alpha">
<li>From the remote server
<li>'''From the remote server.'''
<li>FRom the mounting user's uid and gid.
<li>From the mounting user's uid and gid.
</ol>
</ol>
<li>Which of the following is sufficient to allow a process to be able to read a regular file?
<li>Which of the following is sufficient to allow a process to be able to read a regular file?
Line 59: Line 59:
<li>Process's gid matches the file's gid.
<li>Process's gid matches the file's gid.
<li>The process's uid and gid match the file's uid and gid.
<li>The process's uid and gid match the file's uid and gid.
<li>None of the above.
<li>'''None of the above.'''
</ol>
<li> In sshfs, what determines whether a file operation is allowed or not?
<ol style="list-style-type:lower-alpha">
<li>the remote ssh daemon
<li>'''the remote kernel'''
<li>the local kernel
<li>the local ssh process
</ol>
</ol>
<li> In sshfs, what determines whether a file operation is allowed or not, the remote ssh daemon, the remote kernel, the local kernel, or the local ssh process?
<li> When you run fusermount via execve, what euid does fusermount's process have?
<li> When you run fusermount via execve, what euid does fusermount's process have?
<ol style="list-style-type:lower-alpha">
<li>euid is equal to the uid of the calling user (process that did the execve of fusermount)
<li>euid is the uid of fuse
<li>'''euid=0 (root)'''
<li>None of the above
</ol>
<li> What environment variable allows ssh to connect to the local authentication agent?
<li> What environment variable allows ssh to connect to the local authentication agent?
<ol style="list-style-type:lower-alpha">
<li>'''SSH_AUTH_SOCK'''
<li>TERM
<li>SSH_AGENT_LAUNCHER
<li>DISPLAY
</ol>
<li> Why must ssh private keys only be readable by the owner?
<li> Why must ssh private keys only be readable by the owner?
<li> How do you control how many bytes dd writes with each write system call?
<ol style="list-style-type:lower-alpha">
<li> When you make a write system call to a file on a sshfs-mounted filesystem, how many additional write (or writev) system calls must be executed, and what processes make those system calls?
<li>Other regular users on the system could use the private key to impersonate the owner.
<li>ssh and ssh-add will refuse to use the key.
<li>'''Both (a) and (b)'''
<li>None of the above
</ol>
<li> What option to you give to dd to control how many bytes dd writes with each write system call?
<ol style="list-style-type:lower-alpha">
<li>'''bs='''
<li>ibs=
<li>count=
<li>None of the above
</ol>
<li> When you make a write system call to a file on a sshfs-mounted filesystem (to a file that the user has write access to) , which of the following also happens?
<ol style="list-style-type:lower-alpha">
<li>'''A remote sftp-server process does a write system call.'''
<li>The local kernel makes a write system call.
<li>The remote kernel makes a write system call.
<li>All of the above.
</ol>
</ol>
</ol>

Latest revision as of 18:18, 7 December 2017

These questions refer to the code from Tutorial 7 and Tutorial 8.

Full Questions

  1. To enable public key (password-less) authentication in ssh, a user's public key should be added to what file on the remote system?
  2. In ssh (on the Linux command line), in what file is a user's private key normally stored?
  3. How do sshfs inode values relate to the inodes in the remotely mounted filesystem?
  4. What lines in memoryll determine the inode numbers?
  5. In sshfs, do a file's uid and gid values come from the remote server or from the mounting user's uid and gid?
  6. What permissions does a process require for regular file access?
  7. In sshfs, what determines whether a file operation is allowed or not, the remote ssh daemon, the remote kernel, the local kernel, or the local ssh process?
  8. When you run fusermount via execve, what euid does fusermount's process have?
  9. What environment variable allows ssh to connect to the local authentication agent?
  10. Why must ssh private keys only be readable by the owner?
  11. How do you control how many bytes dd writes with each write system call?
  12. When you make a write system call to a file on a sshfs-mounted filesystem, how many additional write (or writev) system calls must be executed, and what processes make those system calls?

Multiple Choice

  1. To enable public key (password-less) authentication in ssh, a user's public key should be added to what file on the remote system?
    1. /etc/passwd
    2. ~/.ssh/authorized_keys
    3. ~/.ssh/known_hosts
    4. ~/.ssh/id_rsa.pub
    5. ~/.ssh/id_rsa
  2. In ssh (on the Linux command line), in what file is a user's private key normally stored?
    1. /etc/passwd
    2. ~/.ssh/authorized_keys
    3. ~/.ssh/known_hosts
    4. ~/.ssh/id_rsa.pub
    5. ~/.ssh/id_rsa
  3. How do sshfs inode values relate to the inodes in the remotely mounted filesystem?
    1. The sshfs inode values are identical to those on the remote filesystem.
    2. The sshfs inode values have no relationship to the remote filesystem inode values.
    3. The sshfs inode values are the remote inode numbers plus a fixed offset.
    4. The sshfs inode values are sometimes the same as the remote inode values, and sometimes they are different.
  4. What lines in memoryll determine the inode numbers?
    1. Line 14, self.ino += 1
    2. Line 18, self.ino = 1
    3. Both Line 14 and 18
    4. None of the above
  5. In sshfs, do a file's uid and gid values come from the remote server or from the mounting user's uid and gid?
    1. From the remote server.
    2. From the mounting user's uid and gid.
  6. Which of the following is sufficient to allow a process to be able to read a regular file?
    1. Process's uid matches the file's uid.
    2. Process's gid matches the file's gid.
    3. The process's uid and gid match the file's uid and gid.
    4. None of the above.
  7. In sshfs, what determines whether a file operation is allowed or not?
    1. the remote ssh daemon
    2. the remote kernel
    3. the local kernel
    4. the local ssh process
  8. When you run fusermount via execve, what euid does fusermount's process have?
    1. euid is equal to the uid of the calling user (process that did the execve of fusermount)
    2. euid is the uid of fuse
    3. euid=0 (root)
    4. None of the above
  9. What environment variable allows ssh to connect to the local authentication agent?
    1. SSH_AUTH_SOCK
    2. TERM
    3. SSH_AGENT_LAUNCHER
    4. DISPLAY
  10. Why must ssh private keys only be readable by the owner?
    1. Other regular users on the system could use the private key to impersonate the owner.
    2. ssh and ssh-add will refuse to use the key.
    3. Both (a) and (b)
    4. None of the above
  11. What option to you give to dd to control how many bytes dd writes with each write system call?
    1. bs=
    2. ibs=
    3. count=
    4. None of the above
  12. When you make a write system call to a file on a sshfs-mounted filesystem (to a file that the user has write access to) , which of the following also happens?
    1. A remote sftp-server process does a write system call.
    2. The local kernel makes a write system call.
    3. The remote kernel makes a write system call.
    4. All of the above.