Linux Server Administration Assignment: Account and File Management

Verified

Added on  2023/06/07

|11
|530
|287
Homework Assignment
AI Summary
This assignment solution provides a detailed overview of Linux server administration, covering key aspects such as automated account management, file system design, and the use of shell scripts. It begins with creating and running shell scripts for managing user accounts, including creating, removing, and archiving home directories. The solution then delves into designing a file system using ZFS volume, outlining the steps for installing ZFS, viewing disk volumes, and creating a storage pool. Furthermore, the assignment showcases two scripts for file system management, one for ensuring user home directories are owned and accessible only by the owner, and another for identifying and converting files, specifically converting FLAC files to MP3 format using metadata. The solution is based on the provided references of 'Beginning Ubuntu Linux' and 'Ubuntu Netbooks'.
Document Page
er er admini trationLINUX s v s
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Table of Contents
Automated Account Management..............................................................................................2
Designing File Systems..............................................................................................................5
File System Management with Scripts.......................................................................................8
References................................................................................................................................10
1
Document Page
Automated Account Management
This task is used to create the two shell scripts and it is used to manage the user
information. The first shell scripts is reads the text file and it contains the following
information (Thomas and Vugt, 2011).
Shell Script
#!/bin/bash
FILE="/home/ubuntu/Documents"
echo "*** File - $FILE contents ***"
cat $FILE
After, run the shell scripts by typing the following command on terminal. It is shown below.
2
Document Page
After, we will assume the users on the system without any interactive input. It is shown
below.
Second script is to remove the user account by using the below script.
#!/bin/bash
#
for user
do
userdel r $user
done
#
for user1
do
rm -rM /home/$user1
done
3
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
#
The output is shown below.
Home directory archiving is shown below.
4
Document Page
Designing File Systems
Here, we will needs to build the server to store the user data by using the ZFS volume.
So, user needs to install the ZFS by using the below steps.
First, view the sources are enabled or not by enter the following command and it is
demonstrated as below.
5
Document Page
After, update the system.
6
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Then install the ZFS utility.
After, view the disk volume and it is demonstrated as below.
7
Document Page
After, create the pool named as pool-name.
Finally user successfully designed the ZFS volume.
File System Management with Scripts
Here, we will created the two scripts for file system management. The First scripts is
to make the user home directories are owned and only accessible by the owner. It is shown
below.
for dir in /home/ubuntu*
8
Document Page
do
if [ -d "$dir" ]
then
username=$(basename "$dir")
echo "chown -R $username $dir"
fi
done
The second scripts is to looks the file system to find the objects like mp3. It is shown below
(Ubuntu Netbooks, 2010).
#!/bin/sh
file="$1"
outfile=${file%.flac}.mp3
eval $(metaflac --export-tags-to - "$file" | sed "s/=\(.*\)/='\1'/")
flac -cd "$file" | lame --preset fast extreme \
--add-id3v2 --tt "$TITLE" --ta "$ARTIST" --tl "$ALBUM" \
--ty "$DATE" --tn "$TRACKNUMBER" --tg "$GENRE" \
- "$outfile"
9
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
References
Thomas, K. and Vugt, S. (2011). Beginning Ubuntu Linux. New York, NY: Apress.
Ubuntu Netbooks. (2010). Apress.
10
chevron_up_icon
1 out of 11
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]