Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In linux 1) Create 2 new users (your first name & the other your middle name). * both directories should be placed in the /home

In linux

1) Create 2 new users (your first name & the other your middle name).

* both directories should be placed in the /home directory

2) Create 2 new groups (uGroup1 & uGroup2)

* group numbers 150 & 151 and assign them to the new users listed above

Create a shell program that will do the following (must run as root):

A) read in the last 2 lines of /etc/passwd and capture fields for:

user1 > group1

user2 > group2

B) create folders in each of the new user accounts for usr (first user) and etc (second user) . If the folders already exist, then delete them. i.e.

if /home/me/usr

then rm /home/me/usr

** hint - look up 'test' in a shell script **

C) list one file from directory and create variables for the user and the group names.

D) create a file that lists all of the files and sub-directories under the /usr directory. Place the file into first new user account created called usr/usrListing.txt

E) Create a file that lists all of the files and sub-directories under the /etc directory. Place the file into second new user account created called etc/etcListing.txt

F) Change the ownership and the file permissions to match the user and group for each respective file.

Find the correct size in bytes of each of the 2 files that you created and produce an outcome like:

user1 file had xxxxxx bytes

user2 file had xxxxxx bytes

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions