User and File Management
Description
The purpose of this assignment is to get more practice with user and file management.
Part 1 User Management
Use the
/etc/skeldirectory to define profile settings as follows:- Add an alias so that the
rmcommand is run interactively - Set the default editor to
nanousing theEDITORenvironment variable - Add a
.nanorcfile that configures nano to display line numbers, sets a tab size of four characters, and inserts spaces instead of tab characters.
- Add an alias so that the
Set password and account expirations using the
/etc/login.defsfile to have the following requirements: passwords should expire after 90 days, with a five-day warning period.Create four new users with unique names.
Create four new groups with unique names (for example, maybe corresponding to fictional departments.) Place one user from step 3 into each group.
Give one user the ability to use the
apt-getcommand to install software with the sudo command. Make sure to use thevisudocommand to safely edit the/etc/sudoersfile.
Part 2 File Management
Create directories for each of the groups defined above at the root of the file system.
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.
Configure ACL permissions (see the man pages for
getfaclandsetfacl) 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.Configure ACL permissions to permit one user account to have read permissions to the one of the group directories.
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
Create a file named
links.txtin the/optdirectory, and then create a hard link to it in the/tmpdirectory. Use a text editor to add a line of text to the file through the/opt/links.txtpath, and then display the file’s contents by using the/tmp/links.txtfile path.Create a symbolic link to
/tmp/links.txtin the csc510 user’s home directory and view the file’s contents.Delete the
/tmp/links.txtfile, and then attempt to view the file’s contents through the~csc510/links.txtsymbolic link.Create 10 files in the
/tmpdirectory, and then usetarandgzipto bundle and compress the files.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:
A copy of the
/etc/skeldirectory for part 1.1.A copy of the
/etc/login.defsfor part 1.2.A copy of the
/etc/sudoersfile for part 1.5.A file named
commands.txtthat lists the commands you used for each of the other parts and the corresponding output. Label the parts clearly in the file.
Then submit that file to the appropriate folder on D2L.
Grading Criteria
- Correct implementation of the specification