logo

Server Administration: Linux and Server

   

Added on  2023-06-07

10 Pages1096 Words123 Views
Running Head: SERVER ADMINISTRATION 1
Linux and Server
Institution
Date
Name
Section 1: Automated Account Management (4 marks)

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"

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

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Server Administration: Automated Account Management, File System Design, ZFS on Linux, File System Management with Scripts
|10
|1507
|85

SEO Suggestions for Desklib - Online Library for Study Material
|6
|1201
|456

Server Administration and Management with Shell Scripts and ZFS Volume
|13
|695
|492