Question

In: Computer Science

USING COMMAND PROMPT ON LINUX. show how... Linux Users, Groups, and Permissions Lab Objective: Understand how...

USING COMMAND PROMPT ON LINUX. show how...

Linux Users, Groups, and Permissions Lab

Objective:

Understand how to create user accounts
Understand how to create group accounts
Creating good password policies
Understanding permissions and file sharing

Setup:

You will need a Ubuntu Server VM

Walk Through:

You are a system administrator who has been tasked to create user accounts for new users on your system. You can pick whatever theme you like as long as there are protagonist and antagonist users: i.e. Super Hero’s and Villains, Harry Potter Characters, or other interests of yours.

Create 2 groups:
One for the Protagonists
One for the Antagonists

Create 5 users:
2 Protagonists
2 Antagonists
1 Neutral – Can access both group's files

User Configuration:
Each user will have their own home directory that only they can access.
Users must change their password when they first log in.
Users are required to change their password after 6 months.

Required Directories in /home:
1. Share – Anyone can access this directory to add or remove
2. Protagonists – Only the protagonists group can add or remove
3. Antagonists – Only the antagonists group can add or remove
***Directory names can be named based on your current theme***

Ensure that you test that each account is working by either switching users, or logging in as different users.

What to Submit:
Submit a lab report documenting your process.

Make sure to include:

  • A screenshot of the listing of the /home directory of the system showing the users home directories and the additional group directories.
  • A screenshot showing the listing of the file /etc/groups.
  • Screenshots that shows the permissions of the protagonists and antagonists directories.
  • Output from the chage -l <username> for each of the five users.

Solutions

Expert Solution

Initially for better results you need to modify /etc/adduser.conf . It will be applicable on all the accounts that you configure.onf file.The changes you make in this file will be applicable on all the accounts that will be created now. Type in the following command to access /etc/adduser.conf.In case you are not in the root mode switch to root mode by running command sudo -s. In case you are not able to see the terminal in ubuntu press CTRL+ALT+T.

In this file you need to change DIR_MODE=700 in order so that only perticular user has access to his directory.

$ cat /etc/adduser.conf | grep -v "^#" | grep -v "^$"
DSHELL=/bin/bash
DHOME=/home
GROUPHOMES=no  
LETTERHOMES=no
SKEL=/etc/skel
FIRST_SYSTEM_UID=100
LAST_SYSTEM_UID=999
FIRST_SYSTEM_GID=100
LAST_SYSTEM_GID=999
FIRST_UID=1000
LAST_UID=29999
FIRST_GID=1000
LAST_GID=29999
USERGROUPS=yes
USERS_GID=100
DIR_MODE=0755 change this to 700
SETGID_HOME=no
QUOTAUSER=""
SKEL_IGNORE_REGEX="dpkg-(old|new|dist|save)"

After this you need to remain in the root mode and create 5 users by the following command

$ sudo adduser katniss
Adding user `Katniss` (1001) ...
Adding new user `katniss' (1001) with group `protagonist' ...
Creating home directory `/home/Ka'tniss ...
Copying files from `/etc/skel' …
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for Katniss
Enter the new value, or press ENTER for the default
        Full Name []: katniss katniss
        Room Number []:
        Work Phone []:
        Home Phone []:
        Other []:
Is the information correct? [Y/n] Y

Similarly you can create 4 users one i have already created for protagonist

in order that user must change their password at next login you must run the command

$ sudo chage -d 0 Katniss

you can set the limit of 6 months for password change by using following command

chage -m 180 katniss

first you need to create group like protagonist. To do this run the command

sudo groupadd protagonist

To add user account to a group . Run the command

usermod -a -G protagonist katniss

Related Solutions

LINUX In Linux command line write a shell script ex1.sh that uses IF THEN to Prompt...
LINUX In Linux command line write a shell script ex1.sh that uses IF THEN to Prompt the user to "Enter a number between 1 and 10". (Hint: Use the 'echo' and 'read' commands in the script. See the slide about the 'read' command) If the number is less than 5, print "The number is less than 5" (Hint: You will read input into a variable; e.g. read NUM. In the IF statement, enclose $NUM in quotes; e.g. "$NUM". Also, remember...
unix/Linux Create a tar command using the man command and the link referred to in To...
unix/Linux Create a tar command using the man command and the link referred to in To Practice and Explore: Text File Utilities #9. Preliminaries Use the man pages to learn more about tar Review the links referred to in To Practice and Explore: Text File Utilities #9 to see examples of using tar command Perform Use tar "to stuff" three files and then "unstuff" them into a new directory. Include the -v option. Task ll to show the original 3...
In MongoDB using Linux how do you Execute the command to find the size of a...
In MongoDB using Linux how do you Execute the command to find the size of a single document of your choosing from the enron database Execute the command to find the size of the collection of documents in the enron database
Use Linux fedora At the command prompt, type route and press Enter. What entries are listed?...
Use Linux fedora At the command prompt, type route and press Enter. What entries are listed? What does each entry represent? What IPv4 address is listed as your default gateway? At the command prompt, type ip route add 1.0.0.0/8 via gwIP and press Enter, where gwIP is the IPv4 address of your default gateway. At the command prompt, type route and press Enter. Is the route added in Step 3 visi- ble? Will this route interfere with traffic that is...
Create by using Linux server • Create a file name it foo.txt • Remove all permissions...
Create by using Linux server • Create a file name it foo.txt • Remove all permissions from foo.txt • What happen if you try to read the file? • Change foo.txt permission to read and write only for owner • Change foo.txt permission to read for group • Change foo.txt permission to read and write everyone
Lab 1. Java and the Command Prompt a) Visit the Java SE JDK website and see...
Lab 1. Java and the Command Prompt a) Visit the Java SE JDK website and see which version of Java you need to download. b) If granted permissions, try to see how to modify environment variables (PATH and CLASSPATH). c) Open the command prompt/shell. Use cd and dir (ls on UNIX-like systems) commands to navigate your file system and see what files do you have in different locations e.g. on your flash drive. Pay attention to the file extensions. d)...
Using Linux in VirtualBox Do the Following Exercise: Using the clear command At this point, you...
Using Linux in VirtualBox Do the Following Exercise: Using the clear command At this point, you screen might seem filled with commands and their results. Use the clear command anytime you want a clean slate. This exercise enables you to clear the screen now. To clear the screen: Type clear on the command line, and press Enter. The command prompt is now in the upper-left corner of your screen. [No output or questions for this part.] Viewing manual pages You...
Linux What is the tar command? a. Can you compress files using tar? Please explain how...
Linux What is the tar command? a. Can you compress files using tar? Please explain how and provide a brief example. b. How do you create a tar file? Please provide an example. c. How do you extract files in a tar format? Please provide an example.
Using Linux in VirtualBox To display your system date: Type date in the command line, and...
Using Linux in VirtualBox To display your system date: Type date in the command line, and press Enter. What do you see?                                            You might see the abbreviation EDT (Eastern Daylight Time) instead of EST (Eastern Standard Time), or another time zone abbreviation, such as MDT (Mountain Daylight Time) or CST (Central Standard Time). Notice also that UNIX/Linux uses a 24-hour clock. Type Date in the command line, and press Enter. What error do you see?                                    The system error...
Systems Programming in Linux using C Remake the version of the ls -ialR command in C.....
Systems Programming in Linux using C Remake the version of the ls -ialR command in C.. In this version of ls, you must also consider symbolic file types. Make sure you have file header comments and function header comments. Also, write inline comments whenever necessary.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT