User and File Management

Description

The purpose of this assignment is to get more practice with user and file management.

Part 1 User Management

  1. Use the /etc/skel directory to define profile settings as follows:

    • Add an alias so that the rm command is run interactively
    • Set the default editor to nano using the EDITOR environment variable
    • Add a .nanorc file that configures nano to display line numbers, sets a tab size of four characters, and inserts spaces instead of tab characters.
  2. Set password and account expirations using the /etc/login.defs file to have the following requirements: passwords should expire after 90 days, with a five-day warning period.

  3. Create four new users with unique names.

  4. Create four new groups with unique names (for example, maybe corresponding to fictional departments.) Place one user from step 3 into each group.

  5. Give one user the ability to use the apt-get command to install software with the sudo command. Make sure to use the visudo command to safely edit the /etc/sudoers file.

Part 2 File Management

  1. Create directories for each of the groups defined above at the root of the file system.

  2. Configure permissions and ownership such that only each group has access to its own group directories. That is, for a given group and corresponding directory, only members of the group can access that directory.

  3. Configure ACL permissions (see the man pages for getfacl and setfacl) to permit one group to have read access to another groups directory. Note: run the command “sudo apt install acl” to install to the above commands.

  4. Configure ACL permissions to permit one user account to have read permissions to the one of the group directories.

  5. Configure the SGID and sticky bit on one of the group directories. Test this somehow. (Make a comment about how you tested this in the assignment submission.)

Part 3 Miscellaneous File Management

  1. Create a file named links.txt in the /opt directory, and then create a hard link to it in the /tmp directory. Use a text editor to add a line of text to the file through the /opt/links.txt path, and then display the file’s contents by using the /tmp/links.txt file path.

  2. Create a symbolic link to /tmp/links.txt in the csc510 user’s home directory and view the file’s contents.

  3. Delete the /tmp/links.txt file, and then attempt to view the file’s contents through the ~csc510/links.txt symbolic link.

  4. Create 10 files in the /tmp directory, and then use tar and gzip to bundle and compress the files.

  5. Delete the 10 original files and then restore them from your tarball.

Turning in the Assignment

To submit your assignment, create a gzipped tar file named project4.tgz of a DIRECTORY named project4 containing the following:

Then submit that file to the appropriate folder on D2L.

Grading Criteria