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/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 theEDITOR
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.
- Add an alias so that the
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.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-get
command to install software with the sudo command. Make sure to use thevisudo
command to safely edit the/etc/sudoers
file.
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
getfacl
andsetfacl
) 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.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.Create a symbolic link to
/tmp/links.txt
in the csc510 user’s home directory and view the file’s contents.Delete the
/tmp/links.txt
file, and then attempt to view the file’s contents through the~csc510/links.txt
symbolic link.Create 10 files in the
/tmp
directory, and then usetar
andgzip
to 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/skel
directory for part 1.1.A copy of the
/etc/login.defs
for part 1.2.A copy of the
/etc/sudoers
file for part 1.5.A file named
commands.txt
that 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