Linux Server Administration: Automating User Accounts & ZFS Volumes
VerifiedAdded on 2023/06/07
|10
|1096
|123
Practical Assignment
AI Summary
This practical assignment focuses on Linux server administration, detailing the automation of user account management using shell scripts, including reading usernames, home directories, and GECOS strings from a file, generating passwords, and adding users with appropriate configurations. It further explores file system design, user deletion, and the installation of ZFS utilities, demonstrating the setup of a ZFS RAID 0 pool. The assignment also covers network connectivity checks, mounting shared directories, and implementing ZFS volume backup processes through snapshots, including sending backups to remote machines. Finally, it delves into file system management with scripts, showcasing techniques for retrieving file information, duplicating items, creating directories, and modifying file system access controls, with references to relevant academic literature.

Running Head: SERVER ADMINISTRATION 1
Linux and Server
Institution
Date
Name
Section 1: Automated Account Management (4 marks)
Linux and Server
Institution
Date
Name
Section 1: Automated Account Management (4 marks)
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

SERVER ADMINISTRATION
First Script
Clear
Reading the Username from the users.txt file:
un=`cat users.txt|cut -d " " -f 1`
Reading the the Home Directory from users.txt:
hd=`cat users.txt|cut -d " " -f 2`
Reading the gecos string from users.txt:
g=`cat users.txt|cut -d " " -f 3-4`
Coming up with the arbitrary password:
pass=head /dev/urandom | tr -dc A-Za-z0-9 | head -c 8 ; echo '''
Show/display the Password on the screen:
echo "The password of user $un is $pass"
Adding the user by useradd command:
adduser -d $hd -c "$g" $un
Assigning the password and redirecting the output into/dev/null:
(echo $p|passwd $un --stdin) >/dev/null
Section 2. Designing a File system
echo "Enter your username"
First Script
Clear
Reading the Username from the users.txt file:
un=`cat users.txt|cut -d " " -f 1`
Reading the the Home Directory from users.txt:
hd=`cat users.txt|cut -d " " -f 2`
Reading the gecos string from users.txt:
g=`cat users.txt|cut -d " " -f 3-4`
Coming up with the arbitrary password:
pass=head /dev/urandom | tr -dc A-Za-z0-9 | head -c 8 ; echo '''
Show/display the Password on the screen:
echo "The password of user $un is $pass"
Adding the user by useradd command:
adduser -d $hd -c "$g" $un
Assigning the password and redirecting the output into/dev/null:
(echo $p|passwd $un --stdin) >/dev/null
Section 2. Designing a File system
echo "Enter your username"

SERVER ADMINISTRATION
read usnme
grep $usnme /etc/passwd
if test $? -eq 0
then
hd=`grep $usnme /etc/passwd|cut -d ":" -f 6`
tar -czf /tmp/back1.tar $hd
userdel -r $usnme
PART 3:
Install ZFS utility
read usnme
grep $usnme /etc/passwd
if test $? -eq 0
then
hd=`grep $usnme /etc/passwd|cut -d ":" -f 6`
tar -czf /tmp/back1.tar $hd
userdel -r $usnme
PART 3:
Install ZFS utility
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

SERVER ADMINISTRATION
Setting Up ZFS RAID 0 Pool
Create ZFS pool files in RAID 0 setup.
Section 4:
First we must check the connectivity between the server:
# ping <IP of the Server>
Setting Up ZFS RAID 0 Pool
Create ZFS pool files in RAID 0 setup.
Section 4:
First we must check the connectivity between the server:
# ping <IP of the Server>
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

SERVER ADMINISTRATION
If the connectivity is working fine, then run the following command to check
what are the files that has been shared by the server:
# showmount –e <Server_name>
If you see that there is a shared directory, you need to mount it in your newly
created server:
Create a directory where you want to mount the files:
# mkdir /mount
Now edit the /etc/fstab file to permanently mount in your local server:
# vi /etc/fstab
If the connectivity is working fine, then run the following command to check
what are the files that has been shared by the server:
# showmount –e <Server_name>
If you see that there is a shared directory, you need to mount it in your newly
created server:
Create a directory where you want to mount the files:
# mkdir /mount
Now edit the /etc/fstab file to permanently mount in your local server:
# vi /etc/fstab

SERVER ADMINISTRATION
Go to the last line and edit
<Server_name>:/Shared_directory /mount nfs defaults 0 0
Now run the below script to finish the step:
# mount -a
ZFS volume back up process:
ZFS actually helps the administrator to perform inexpensive snapshots of already
present mounted file system. A photo of the ZFS files system at a given point.
Now to perform a backup of the ZFS volumes, you need to take a snapshot.
Below is the command of taking a snapshot:
# pfexec zfs snapshot <zpool_name>/<filesystem_name>@snapshot_name
Now check whether the snapshot is taken correctly or not:
Go to the last line and edit
<Server_name>:/Shared_directory /mount nfs defaults 0 0
Now run the below script to finish the step:
# mount -a
ZFS volume back up process:
ZFS actually helps the administrator to perform inexpensive snapshots of already
present mounted file system. A photo of the ZFS files system at a given point.
Now to perform a backup of the ZFS volumes, you need to take a snapshot.
Below is the command of taking a snapshot:
# pfexec zfs snapshot <zpool_name>/<filesystem_name>@snapshot_name
Now check whether the snapshot is taken correctly or not:
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

SERVER ADMINISTRATION
# zfs list –t snapshot
The Next step is to take the backup of the snapshot. So run the following
command:
Here we are dumping the snapshot using a This command:
# pfexec zfs send <zpool_name>/ <filesystem_name>@snapshot_name >
backup_file
This file has entire ZFS mounted volumes along with the files and metadata.
Suppose you want to send the backup to another machine, then Execute:
# zfs send <zpool_name>/<filesystem_name>@snapshot_name | ssh
remote_host zfs receive <zpool_name1>/<filesystem_name>
Section 5: File System Management with Scripts.
Get-ChildItem - Path C:\ - Force/*get way from item*/
Get-ChildItem - Path $environment:ProgramFiles - Recurse/*get the way from
# zfs list –t snapshot
The Next step is to take the backup of the snapshot. So run the following
command:
Here we are dumping the snapshot using a This command:
# pfexec zfs send <zpool_name>/ <filesystem_name>@snapshot_name >
backup_file
This file has entire ZFS mounted volumes along with the files and metadata.
Suppose you want to send the backup to another machine, then Execute:
# zfs send <zpool_name>/<filesystem_name>@snapshot_name | ssh
remote_host zfs receive <zpool_name1>/<filesystem_name>
Section 5: File System Management with Scripts.
Get-ChildItem - Path C:\ - Force/*get way from item*/
Get-ChildItem - Path $environment:ProgramFiles - Recurse/*get the way from
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

SERVER ADMINISTRATION
programming files*/
- Include *.exe | Where-Object - FilterScript/*to discover the protest from
script*/
- and ($_.Length - ce information stockpiling) - and ($_.Length - le information
stockpiling)
Duplicate Item - Path C:\boot.
ini - Destination C:\boot.dat/*to duplicate the thing from directory*/
(New-Object - scriptObject Scripting.FileSystemObject)
New-Item - Path 'C:\temp\New Folder' - ItemType Directory/*a organizer to
store*/
/* Assumption of home indexes are relatives of/clients
Get-Data-Path C:\boot.ini
[boot loader]
timeout=0
programming files*/
- Include *.exe | Where-Object - FilterScript/*to discover the protest from
script*/
- and ($_.Length - ce information stockpiling) - and ($_.Length - le information
stockpiling)
Duplicate Item - Path C:\boot.
ini - Destination C:\boot.dat/*to duplicate the thing from directory*/
(New-Object - scriptObject Scripting.FileSystemObject)
New-Item - Path 'C:\temp\New Folder' - ItemType Directory/*a organizer to
store*/
/* Assumption of home indexes are relatives of/clients
Get-Data-Path C:\boot.ini
[boot loader]
timeout=0

SERVER ADMINISTRATION
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS[operating systems]
/*The content takes a contention the filesystem name
multidata()disk()rdisk()partition(1)\WINDOWS. mp3 ="receive document"/*to
discover the summary*/
/noexecute=AlwaysOff.aac/fastdetect/*detection of quick execution*/
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS.mp4="Descendants of clients"
with Data Execution Prevention"/notexecuted=option/datadetect
(Get-Content - Path C:\boot.initiate).Length.avi()/*to discover the length of
information storage*/
/*to discover the commencement of contention storage*/
$System = Get-Context - Path C:\temporary\DomainMembers.txt
$scl = Get-Scl \\fs1\shared\files\data
$AccessData
System.Security.AccessControl.FileSystemAccessRule("FullControl","Data")
$scl.RemoveAccessDta($AccessData)
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS[operating systems]
/*The content takes a contention the filesystem name
multidata()disk()rdisk()partition(1)\WINDOWS. mp3 ="receive document"/*to
discover the summary*/
/noexecute=AlwaysOff.aac/fastdetect/*detection of quick execution*/
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS.mp4="Descendants of clients"
with Data Execution Prevention"/notexecuted=option/datadetect
(Get-Content - Path C:\boot.initiate).Length.avi()/*to discover the length of
information storage*/
/*to discover the commencement of contention storage*/
$System = Get-Context - Path C:\temporary\DomainMembers.txt
$scl = Get-Scl \\fs1\shared\files\data
$AccessData
System.Security.AccessControl.FileSystemAccessRule("FullControl","Data")
$scl.RemoveAccessDta($AccessData)
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

SERVER ADMINISTRATION
$scl | Set-Scl \\fs1\shared\files
Evacuate Item - Path C:\temp\DeleteMe/*to expel files*/
References
Ab Karim, M. B., Luke, J. Y., Wong, M. T., Sian, P. Y., & Hong, O. (2016, October).
Ext4, XFS, BtrFS and ZFS Linux file systems on RADOS Block Devices
(RBD): I/O performance, flexibility and ease of use comparisons. In Open
Systems (ICOS), 2016 IEEE Conference on (pp. 18-23). IEEE.
LaCroix, J. (2016). Mastering Ubuntu Server. Packt Publishing Ltd.
Shen, Y., & Luo, L. (2014, December). Fwrite: An Approach to Optimize Write
Performance of ZFS on Linux. In Computational Intelligence and Design
(ISCID), 2014 Seventh International Symposium on (Vol. 2, pp. 57-60). IEEE.
Lora, A., Nantista, G., & Pifferi, A. (2016). Setup of a redundant network storage
system. A legacy approach. SMART eLAB, 8, 1-8.
Wojsław, D. (2017). Installation. In Introducing ZFS on Linux(pp. 41-49). Apress,
Berkeley, CA.
$scl | Set-Scl \\fs1\shared\files
Evacuate Item - Path C:\temp\DeleteMe/*to expel files*/
References
Ab Karim, M. B., Luke, J. Y., Wong, M. T., Sian, P. Y., & Hong, O. (2016, October).
Ext4, XFS, BtrFS and ZFS Linux file systems on RADOS Block Devices
(RBD): I/O performance, flexibility and ease of use comparisons. In Open
Systems (ICOS), 2016 IEEE Conference on (pp. 18-23). IEEE.
LaCroix, J. (2016). Mastering Ubuntu Server. Packt Publishing Ltd.
Shen, Y., & Luo, L. (2014, December). Fwrite: An Approach to Optimize Write
Performance of ZFS on Linux. In Computational Intelligence and Design
(ISCID), 2014 Seventh International Symposium on (Vol. 2, pp. 57-60). IEEE.
Lora, A., Nantista, G., & Pifferi, A. (2016). Setup of a redundant network storage
system. A legacy approach. SMART eLAB, 8, 1-8.
Wojsław, D. (2017). Installation. In Introducing ZFS on Linux(pp. 41-49). Apress,
Berkeley, CA.
1 out of 10
Related Documents
Your All-in-One AI-Powered Toolkit for Academic Success.
+13062052269
info@desklib.com
Available 24*7 on WhatsApp / Email
Unlock your academic potential
Copyright © 2020–2025 A2Z Services. All Rights Reserved. Developed and managed by ZUCOL.


