Question

In: Computer Science

Using your Virtual machine, do the following tasks. Put the commands you executed in this document....

Using your Virtual machine, do the following tasks. Put the commands you executed in this document.

PART1:

            You will be required to add 3 users to your system. For the sake of simplicity, use the following information for your user accounts:

USER1

Full Name / Comment: George Jetson

Username: jetsong

Password: jetsong

USER2

            Full Name / Comment: Fred Flintstone

            Username: flintstonef

            Password: flintstonef

USER3

            Full Name / Comment: Johnny Bravo

            Username: bravoj

            Password: bravoj

Requirements: You must add the users as displayed above, when creating an account; you must only use the useradd command from the command line (NO GUI). You must also make sure that each user has a valid home folder under /home. You should set their SHELL to /bin/bash.

Each user should have the necessary password set for their account as well as the description (a.k.a. comment field) for future reference if needed. Each user has to change their password on their first login, and the password needs to be changed every 60 days. Johnny was only hired temporarily and his account will need to expire in 3 months, so after 3 months, Johnny should not be able to gain access to his account.

You have to use the specific commands available in Linux to either create a user with all pertinent information all at once, or by utilizing other commands which will help modify existing users with updated info piece by piece – like comments.

Put your commands here:

PART2:

You must create a directory structure to this effect off the root of the file system (/):

image.png


The Cartoons folder should be owned by root, and the primary group set to cartoons

The Jetsons folder should be owned by jetsong, and the primary group set to cartoons.

·         The permissions on the folder should allow George to have FULL permissions and no permissions for anyone else.

The Flintstones folder should be owned by flintstonef, and the primary group set to cartoons.

·         The permissions on the folder should allow Fred to have FULL permissions and no permissions for anyone else.

The JohnnyBravo folder should be owned by bravoj, and the primary group set to cartoons.

·         The permissions on the folder should allow Johnny to have FULL permissions and no permissions for anyone else.

The Shared folder should be owned by root, and the primary group set to entertainment.

·         The permissions should be FULL permissions to root and FULL permissions to the primary group, and the ability for your account to access and read the folder and everything within (including music and videos)

Under each folder in Cartoons, make a symbolic link called ‘Shared’, to the‘Shared’ folder under ‘Entertainment’

The Shows and Movies directories should be owned by root and the primary group should be set to entertainment.

·         The permissions should be FULL permissions to root and FULL permissions to the primary group and no other permissions.

Put your commands here:

Question 1: Log into your system using the accounts you created from above and see what happens when you try and access the specific folders within Cartoons, what happens?

Question 2: What permissions are needed in order for anyone in the group cartoons to access any of the individualized folders within Cartoons?

Question 3: What command would you use to assure that regardless of who creates folders within the Shared folder that the primary group is always entertainment?

Question 4: What groups do the users have to be in, to be able to write to the shared folder?

Submission requirements:

·         Hilight answers in YELLOW

·         Include: a copy of your password file (not a screenshot)

·         A copy of your groups file   (not a screenshot)… you can put the 3 files in a folder, then compress the folder to zip file

Your submission must be uploaded to SLATE as ONE zip file, called ‘Firstname-Lastname-A1.zip’ (use your name).

If you have any questions, please contact your teacher.

Solutions

Expert Solution

Part -1:-

1. Make sure you are logged in as root user.

2. Create an Entertainment folder on Root directory (/)

mkdir /Entertainment

Create Cartoons folder and inside Entertainment Directory

               mkdir /Entertainment/Cartoons

3. Creating 3 users required for the subsequent operations

useradd -c "Gearge Jetson" -d /home/jetsong -s /bin/bash jetsong

useradd -c "Fred Flinstone" -d /home/flintstonef -s /bin/bash flintstonef

useradd -c "Johny Bravo" -d /home/bravoj -s /bin/bash bravoj

Note:

c – For adding a comment of full name

d – For adding a default home directory

s – Assigning a default shell

4. Assigning passwords to the users created above

passwd jetsong

passwd flintstonef

passwd bravoj

5. Forcing the user to change password on first login

chage -d 0 jetsong

chage -d 0 flintstonef

chage -d 0 bravoj

6. Setting the password expiry of each user to 60 days

               chage -M 60 jetsong

chage -M 60 flinstonef

chage -M 60 bravoj

7. Setting the account to expire in 3 months for “bravoj” being a temporary employee.

chage -E "2020-09-21" bravoj

-------------------------------------------------------------------

Part -2:-

Remember to be logged in as root user. Issue the “su – root” or just “su” (in some flavours of Linux) command

8. Creating 2 new groups required for the subsequent operations

groupadd cartoons

groupadd entertainment

9. Creating a new folder “Cartoons” as root user and set the primary group to “cartoons”

mkdir Cartoons

chgrp cartoons Cartoons

10. Create a folder “Jetsons” owned by user “jetsons” and set the primary group to “cartoons” and full permission for jetsons and no permission for anyone else.

mkdir Jetsons

chown jetsong Jetsons/

chgrp cartoons Jetsons/

chmod 700 Jetsons/

11. Create a folder “Flintstonesf” owned by user “flintstonef” and set the primary group to “cartoons” and full permission for flintstonef and no permission for anyone else.

mkdir Flintstones

chown flintstonef Flintstones/

chgrp cartoons Flintstones/

chmod 700 Flintstones/

12. Create a folder “JohnyBravo” owned by user “bravoj” and set the primary group to “cartoons” and full permission for bravoj and no permission for anyone else.

mkdir JohnyBravo

chown bravoj JohnyBravo/

chgrp cartoons JohnyBravo/

chmod 700 JohnyBravo/

13. Create a folder “Shared” owned by user “root” and set the primary group to “entertainment” and full permission for root and full permission to primary group users and only read permission for everyone else including everything within (music & video folder)

mkdir Shared

chgrp entertainment Shared/

mkdir Shared/music

mkdir Shared/videos

For recursive file permission change issue the following command

chmod -R 774 Shared/

14. Create a symbolic link called “Shared” of the “Shared” directory inside every folder under “Cartoon” Directory

ln -s /Entertainment/Shared /Entertainment/Jetsons/

ln -s /Entertainment/Shared /Entertainment/Flintstones/

ln -s /Entertainment/Shared /Entertainment/JohnyBravo/

15. “Shows” and “Movies” directory should be owned by “root” and primary group set to “entertainment”

mkdir /Entertainment/Movies

mkdir /Entertainment/Shows

chgrp entertainment /Entertainment/Movies

chgrp entertainment /Entertainment/Shows

chmod 770 /Entertainment/Movies

chmod 770 /Entertainment/Shows

Question 1:

Log into the system as user jetsong and try accessing the folders inside /Entertainment/Cartoons

The users jetsong will only be allowed to enter the Jetsons directory which it owns

The rest of the directories when trying to enter will generate a permission denied message.

+ arun@ubuntu: -/Desktop arun@ubuntu:-/Desktop$ su jetsong Password: jetsong@ubuntu:/home/arun/Desktop$ cd /Entertainment/Car

The same is the case with every other user trying to access the directories not owned by them that is inside the Cartoons directory.

Question 2:

To change this you have two options .

Option 1

Folder permissions can be changed for either of Jetsons, Flintstones or JohnyBravo directories to allow access to users belonging to groups other than the group of the primary user (folder owner).

Let us consider the example scenario of user jetsong. First the users primary group needs to be changed to cartoons.

Next the file permissions of every directory inside /Entertainment/Cartoons including needs to be changed as follows

usermod -g cartoons jetsong

chmod -R 750 /Entertainment/Cartoons

The first command changes the primary group of jetsong to cartoons

The second command allows read, execute permission for users in cartoon group.

jetsong@ubuntu:/Entertainment/Cartoons $ exit exit arun@ubuntu:-/Desktop$ su jetsong Password: jetsong@ubuntu:/home/arun/Desk

Question 3.

New files & folder inside Shared folder should always have the primary group entertainment

cd /Entertainment/Shared

umask 002            # allow group write; everyone must do this

chgrp entertainment .    # set directory group to GROUPNAME

chmod g+s .          # files created in directory will be in group GROUPNAME

Question 4.

Users have to be in the entertainment group to write to the shared folder.

-------------------------------------------------------------------

Please give me a UPVOTE. Thank you :)


Related Solutions

2. The HTML document on the following page consists of JavaScript code executed when the document...
2. The HTML document on the following page consists of JavaScript code executed when the document is loaded. It prompts the user for his/her name (first and last names) then outputs the greeting “Hello Mr. _____!” or “Hello Ms. _____!” (where _____ is the user’s last name) depending on whether the first name is recognized as a male name. (In the code, only three male names are checked; a realistic program would check many more names.) We allow for the...
Run the commands used for following tasks and paste the screen shots here: a) Search/find a...
Run the commands used for following tasks and paste the screen shots here: a) Search/find a specified word in a file and display all the lines containing that word. b) List all the files and directories in the current directory (including the hidden files). c) Change to the root directory / and show a complete long listing of it. d) Append the output of file1 to file2. [1 Mark] e) Count how many lines, words and characters in file1. f)...
Execute ipconfig/all on a Windows 10 machine (use your virtual Windows 10 machine or your own...
Execute ipconfig/all on a Windows 10 machine (use your virtual Windows 10 machine or your own Win 10 machine). Execute "arp -a" on a Windows 10 machine You can, for example, redirect your ipconfig output to a file and then you can append your arp output by using output redirection ('>' and '>>')as follows. You must then submit that file as part of the assignment; allows your answers to be verified ipconfig /all > module4_hw.txt arp -a >> module4_hw.txt Answer...
In Project 13-1, you configured the DHCP daemon (dhcpd) on your Fedora Linux virtual machine. On...
In Project 13-1, you configured the DHCP daemon (dhcpd) on your Fedora Linux virtual machine. On your Ubuntu Server Linux virtual machine, install and configure udhcpd to provide the same functionality described in Project 13-1, and test your settings by configuring your Fedora Linux virtual machine as a DHCP client that obtains IPv4 configuration from udhcpd. Finally, restore your original configuration.
Imagine, you are an Internal Auditor of the college and you meant to do following tasks....
Imagine, you are an Internal Auditor of the college and you meant to do following tasks. Please justify your answer with examples.   What Monitoring techniques you can apply for documentation purpose. Please also advise which one do you think is the most cost-effective control?
Virtual Projects Research about virtual projects. Based on your research, answer the following questions: -Which virtual...
Virtual Projects Research about virtual projects. Based on your research, answer the following questions: -Which virtual project problems are unique to the phenomenon of being dispersed and which are common project problems in any project? -Which virtual problems are the most serious for virtual projects? Why? Which virtual problems might be fatal for virtual projects? Why? -What are some potential solutions to virtual team problems? Which solutions would apply to regular project teams also? PS: Please respond in a very...
Last week, you explained the concept of a virtual machine. This week, we take it a...
Last week, you explained the concept of a virtual machine. This week, we take it a step further. Describe some of the configuration options when setting up Windows Operating System and Linux on a virtual machine? Which option do you think is most important and why?
(a) From your understanding, when would you use each of the following simulation commands in LTspice?...
(a) From your understanding, when would you use each of the following simulation commands in LTspice? i. DC Operating Point ii. Transient iii. AC Analysis iv. DC Sweep
Using BP. 1. List 2- 3 strategies that your organization has successfully executed in your opinion....
Using BP. 1. List 2- 3 strategies that your organization has successfully executed in your opinion. 2. Describe some of the leadership behaviors that you observed during the time in which these strategies were executed.
How do you plan to continue addressing your tasks/responsibilities throughout the rest of the research, preparation...
How do you plan to continue addressing your tasks/responsibilities throughout the rest of the research, preparation and presentation process? example: I will research on the internet about the controversial views
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT