Server Administration: Automated Account Management, File System Design, ZFS on Linux, File System Management with Scripts

Verified

Added on  2023/06/08

|10
|1507
|85
AI Summary
This article covers automated account management, file system design, ZFS on Linux, and file system management with scripts. It provides tips and scripts for changing user access rights on Ubuntu.

Contribute Materials

Your contribution can guide someone’s learning journey. Share your documents today.
Document Page
Running Head: SERVER ADMINISTRATION 1
Server Administration
Institution
Date
Name
Part 1: Automated Account Management (4 marks)
First Script ``

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
SERVER ADMINISTRATION
Clear; This is first used to clear the terminal
#read the username from users.txt
un=`cat users.txt|cut -d " " -f 1`
#read the Home Directory from users.txt
hd=`cat users.txt|cut -d " " -f 2`
#read the gecos string from users.txt
g=`cat users.txt|cut -d " " -f 3-4`
#generate the random password
p=`head /dev/urandom | tr -dc A-Za-z0-9 | head -c 8 ; echo ''`
#display the password
echo "The password of user $un is $p"
#add the user by useradd command
adduser -d $hd -c "$g" $un
#assign the password and redirect the output into/dev/null
(echo $p|passwd $un --stdin) >/dev/null
PART 2. Design of a File system
echo "Enter the username"
read un
grep $un /etc/passwd
Document Page
SERVER ADMINISTRATION
if test $? -eq 0
then
hd=`grep $un /etc/passwd|cut -d ":" -f 6`
tar -czf /tmp/back1.tar $hd
userdel -r $un
PART 3:
Unlike FreeBSD, ZFS is not part of the Linux base installation due to licensing issues,
which is a unexpected because it would be nice to install Ubuntu on a ZFS pool.
In any case, we can still run ZFS on Linux by installing it with the following commands.
ZFS is a joined record framework and intelligent volume administrator planned and
executed by a group at Sun Microsystems driven by Jeff Bonwick and Matthew Ahrens. Its
advancement began in 2001 and it was authoritatively declared in 2004. In 2005 it was
incorporated into the fundamental trunk of Solaris and discharged as a feature of OpenSolaris.
Right now, as of January 2015, it is local to Solaris, OpenSolaris, OpenIndiana, illumos,
Joyent SmartOS, OmniOS, FreeBSD, Debian GNU/kFreeBSD frameworks, NetBSD, OSv
and bolstered on Mac OS with MacZFS.
On Backups, this framework is totally in light of dataset snapshots and replication back
to our capacity servers utilizing zfsnap and zxfer. zfsnap takes a snapshot each day for a week
and consistently for a month. It discards old ones consequently so you don't amass
overabundance snapshots. For instance, the greater part of our present Jail servers' dataset get
snapshotted, at that point every depiction gets repeated back to the capacity servers. It's quick.
Document Page
SERVER ADMINISTRATION
The ZFS filesystem is accessible for Ubuntu as either a FUSE module or a local portion
module. The part module is given as a matter of course. To introduce the client level
instruments, just introduce:
sudo apt install zfsutils-linux or sudo apt install zfs
For every single current variant from 16.04 ahead.
Notwithstanding have the capacity to have ZFS on root, introduce:
sudo apt install zfs-initramfs
Create ZFS POOL
In the following example, we will create a RAIDZ-2 Storage Pool using 3 hard disks. In
ZFS RAIDZ-2 is like hardware RAID 6 in that two hard disks can fail before the data on the
volume is lost.

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
SERVER ADMINISTRATION
Find Device Name
Zpool Status
That is the zfs now running as proposed on a linux operating system.
PART 5: File System Management with Scripts.
Changing User access rights on ubuntu is not a big task to tackle, One needs only to be
conversant with the following tips:
Utilize chown to change possession and
Document Page
SERVER ADMINISTRATION
chmod to change rights.
utilize the - R choice to apply the rights for all documents within a catalog as well.
Note that both these charges simply work for registries as well. The - R alternative rolls
out them additionally improvement the authorizations for all documents and catalogs within
the registry.
For instance
chown - R username:group catalog
will change proprietorship (for the group and client as well) everything being equal and
catalogs within index and registry itself.
chown username:group catalog
will just change the authorization of the organizer registry however will leave the
documents and envelopes inside the catalog alone.
you have to utilize sudo to change the proprietorship from root to yourself.
Change owner
sudo chown -R $USER:$USER /home/$USER/
Document Page
SERVER ADMINISTRATION
sudo chmod -R 750 /home/$USER/
# get path
path=$1
# display files information
find $path -type f \( -name "*.mp3" -o -name "*.mp4" -o -name "*.aac" -o -name
"*.mov" -o -name "*.avi" -o -name "*.vid" \) | xargs du -sh
# remove files
find $path -type f \( -name "*.mp3" -o -name "*.mp4" -o -name "*.aac" -o -name
"*.mov" -o -name "*.avi" -o -name "*.vid" \) -exec rm -f {} \;

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
SERVER ADMINISTRATION
Alternatively;
Get-ChildItem -Path C:\ -Force /*get path from item*/
Get-ChildItem -Path $environment:ProgramFiles -Recurse /*get the path from
programming files*/
-Include *.exe | Where-Object -FilterScript /*to find the object from script*/
-and ($_.Length -ce data storage) -and ($_.Length -le data storage)
Copy-Item -Path C:\boot.
ini -Destination C:\boot.dat /*to copy the item from directory*/
(New-Object -script Object Scripting.FileSystemObject)
New-Item -Path 'C:\temp\New Folder' -ItemType Directory /*a folder to store*/
/* Assumption of home directories are descendants of /users
Get-Data-Path C:\boot.ini
[boot loader]
timeout=0
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS[operating systems]
/*The script takes an argument the filesystem name
Document Page
SERVER ADMINISTRATION
multidata()disk()rdisk()partition(1)\WINDOWS. mp3 ="receive file" /*to find the
summary*/
/noexecute=AlwaysOff.aac /fastdetect /*detection of fast execution*/
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS.mp4="Descendants of users"
with Data Execution Prevention" /notexecuted=option /datadetect
(Get-Content -Path C:\boot.initiate).Length.avi() /*to find the length of data storage*/
/*to find the initiation of argument storage*/
$System = Get-Context -Path C:\temporary\DomainMembers.txt
$scl = Get-Scl \\fs1\shared\files\data
$AccessData = New-Object
System.Security.AccessControl.FileSystemAccessRule("FullControl","Data")
$scl.RemoveAccessDta($AccessData)
$scl | Set-Scl \\fs1\shared\files
Remove-Item -Path C:\temp\DeleteMe /*to remove 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
Document Page
SERVER ADMINISTRATION
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.
Joyent, Z. F. S. (2014). Performance Analysis and Tools. Retrieved Mar, 12.
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.
Swetha, K., & Sivakumar, A. P. (2015). A Multi-level Services for Scaling of applications in
Cloud Services.
Lora, A., Nantista, G., & Pifferi, A. (2016). Setup of a redundant network storage system. A
legacy approach. SMART eLAB, 8, 1-8.
Olson, J. T., Patil, S. R., Shiraguppi, R. M., & Spear, G. A. (2016). U.S. Patent No.
9,323,462. Washington, DC: U.S. Patent and Trademark Office.
Wojsław, D. (2017). Installation. In Introducing ZFS on Linux(pp. 41-49). Apress, Berkeley,
CA.
1 out of 10
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]

Your All-in-One AI-Powered Toolkit for Academic Success.

Available 24*7 on WhatsApp / Email

[object Object]