Lab 2A> ADDING USERS in Linux

Similar documents
CST8207: GNU/Linux Operating Systems I Lab Seven Linux User and Group Management. Linux User and Group Management

CST8207: GNU/Linux Operating Systems I Lab Seven Linux User and Group Management. Linux User and Group Management

Users, Groups and Permission in Linux

Lab Working with Linux Command Line

Operating Systems Lab 1 (Users, Groups, and Security)

NETW 110 Lab 5 Creating and Assigning Users and Groups Page 1

User Accounts. The Passwd, Group, and Shadow Files

Commands are in black

Lab Authentication, Authorization, and Accounting

CS/CIS 249 SP18 - Intro to Information Security

CST8207: GNU/Linux Operating Systems I Lab Six Linux File System Permissions. Linux File System Permissions (modes) - Part 1

MANAGING THE NONUNIFORM BEHAVIOUR OF TERMINALS AND KEYBOARDS. : WHEN THINGS GO WRONG

User accounts and authorization

The kernel is the low-level software that manages hardware, multitasks programs, etc.

User & Group Administration

TEL2821/IS2150: INTRODUCTION TO SECURITY Lab: Operating Systems and Access Control

Introduction to the UNIX command line

LPI Entry Level Linux Essentials Certificate of Achievement.

CSE 265: System and Network Administration

CSE 390a Lecture 3. Multi-user systems; remote login; editors; users/groups; permissions

File Properties and Permissions

15. Creating a Samba Server in Knoppix v.3

Presented by Bill Genske Gary Jackson

Introduction to Linux

10 userdel: deleting a user account 9. 1 Context Tune the user environment and system environment variables [3]

User Management. René Serral-Gracià Xavier Martorell-Bofill 1. May 26, Universitat Politècnica de Catalunya (UPC)

TEL2821/IS2150: INTRODUCTION TO SECURITY Lab: Operating Systems and Access Control

CST Lab 2 Review #1

Downloading and installing Db2 Developer Community Edition on Red Hat Enterprise Linux Roger E. Sanders Yujing Ke Published on October 24, 2018

Computer Systems and Architecture

Introduction to Unix May 24, 2008

Downloading and installing Db2 Developer Community Edition on Ubuntu Linux Roger E. Sanders Yujing Ke Published on October 24, 2018

Files (review) and Regular Expressions. Todd Kelley CST8207 Todd Kelley 1

Course 144 Supplementary Materials. UNIX Fundamentals

Introduction to Unix - Lab Exercise 0

CSE 390a Lecture 4. Persistent shell settings; users/groups; permissions

LAB #7 Linux Tutorial

CENG 334 Computer Networks. Laboratory I Linux Tutorial

CSE 303 Lecture 4. users/groups; permissions; intro to shell scripting. read Linux Pocket Guide pp , 25-27, 61-65, , 176

Welcome to getting started with Ubuntu Server. This System Administrator Manual. guide to be simple to follow, with step by step instructions

UNIX. Basic UNIX Command

UNIT V. Dr.T.Logeswari. Unix Shell Programming - Forouzan

OPERATING SYSTEMS LINUX

Working with Basic Linux. Daniel Balagué

CSE 390a Lecture 4. Persistent shell settings; users/groups; permissions

Linux Essentials Objectives Topics:

Unix Introduction to UNIX

National University of Computer and Emerging Sciences Operating System Lab - 02 Lab Manual

CIS 192 Linux Lab Exercise

This lab exercise is to be submitted at the end of the lab session! passwd [That is the command to change your current password to a new one]

Find out where you currently are in the path Change directories to be at the root of your home directory (/home/username) cd ~

Linux/Cygwin Practice Computer Architecture

Permission and Ownership

RH-202. RedHat. Redhat Certified Technician on Redhat Enterprise Linux 4 (Labs)

RedHat. Rh202. Redhat Certified Technician on Redhat Enterprise Linux 4 (Labs)

CS CS Tutorial 2 2 Winter 2018

Assume that username is cse. The user s home directory will be /home/cse. You may remember what the relative pathname for users home directory is: ~

Hands-on Keyboard: Cyber Experiments for Strategists and Policy Makers

Installing and Patching Oracle

SANJAY GHODAWAT POLYTECHNIC

Installing and Patching Oracle

Introduction to Linux Workshop 1

Contents. Note: pay attention to where you are. Note: Plaintext version. Note: pay attention to where you are... 1 Note: Plaintext version...

Common UNIX Commands. Unix. User Interfaces. Unix Commands Winter COMP 1270 Computer Usage II 9-1. Using UNIX. Unix has a command line interface

Linux Survival Guide

1. What statistic did the wc -l command show? (do man wc to get the answer) A. The number of bytes B. The number of lines C. The number of words

Computer Systems and Architecture

IT Essentials II: NOS Linux Labs Using Knoppix

CS Fundamentals of Programming II Fall Very Basic UNIX

[ Terminal ] [ Users management ] Alt +F6 = Terminal switcher. useradd [option] JohnG

CTEC1863/2018F Bonus Lab Page 1 of 5

MTU Computer Structure

CS197U: A Hands on Introduction to Unix

CSCI 2132 Software Development. Lecture 5: File Permissions

Redhat Basic. Need. Your. What. Operation G U I D E. Technical Hand Note template version

Chapter 5: User Management. Chapter 5 User Management

CSCI 2132 Software Development. Lecture 4: Files and Directories

CENG393 Computer Networks Labwork 1

Chapter 8: Security under Linux

Unix/Linux Basics. Cpt S 223, Fall 2007 Copyright: Washington State University

INF322 Operating Systems

LAB 0: LINUX COMMAND LINE AND SVN

Linux Operating System Environment Computadors Grau en Ciència i Enginyeria de Dades Q2

Linux Command Line Primer. By: Scott Marshall

Installing QuickBooks Enterprise Solutions Database Manager On Different Linux Servers

Exercise Sheet 2. (Classifications of Operating Systems)

Lab - Configure Users and Groups in Windows

Due: February 26, 2014, 7.30 PM

Introduction to Linux

INTRODUCTION TO LINUX

DELL EMC UNITY: DR ACCESS AND TESTING. Dell EMC Unity OE 4.3

Getting Started With UNIX Lab Exercises

commands exercises Linux System Administration and IP Services AfNOG 2015 Linux Commands # Notes

Session 1: Accessing MUGrid and Command Line Basics

How to Create a NetBeans PHP Project

THE HONG KONG POLYTECHNIC UNIVERSITY Department of Electronic and Information Engineering

RWT Network System Installation Guide

Lab 3a Using the vi editor

CSE/ISE 311: Systems Administra5on Access Control and Processes

Intro to Linux. this will open up a new terminal window for you is super convenient on the computers in the lab

Transcription:

Lab 2A> ADDING USERS in Linux Objective In this lab, student will learn how to create user accounts using the Linux operating system. Scenario The XYZ Company has just installed a server running Linux. The company needs an IT personnel to log onto the server and create users account so that users can log in to the server. Procedures You need to create 5 users as follows: Username: Password: TomTimm default123 ChristyTan 123default BenjaminLim password07 JohnGram 07password MarkWebber 12345678 Step 1: Log in to the Linux server as root: Username: root Password: get from Instructor Open a terminal console > Click Applications > System Tools > Terminal Step 2: The useradd Command At the command prompt, type the command: useradd TomTimm and hit enter. Step3: The passwd Command At the command prompt, type the command: passwd TomTimm and hit enter. The system will ask you to enter a new password. Type default123 and hit enter. The system will ask you to Retype new password. Type deault123 and hit enter again. The system will display token updated successfully. Step4: Test the account At the command prompt, type the command: su TomTimm and hit enter. The system will bring you to TomTimm account. Type su - and hit enter to return to root account. Type the root password if prompted.

Repeat Step 2 to 4 for the other 4 accounts. Step 5: Deleting Users To delete an account, the Linux administrator uses the userdel command. To verify user account TomTimm created earlier, type: finger TomTimm There should be a home directory created. Next delete the account, type: userdel r TomTimm Verify the user account existence by typing:

finger TomTimm As you can see, there is no such user as TomTimm which means the userdel r command has deleted the user TomTimm plus the home directory. Lab 2B - Creating Groups in Linux Objective In this lab, the student will learn how to create, rename, and delete groups using the Linux operating system. The student will then add members to that group. Scenario A few members in the Engineering Department, who are using Linux, are going to be working on classified documents. They need to have their own group created so they can keep these documents in certain folders that only their group will have permissions to. A group must be created and members added to this group. Procedures In this lab, the student will first create the engineering group and then add the localuser1 user account to this group. The student will then rename the group. For the last step, the student will delete the group. Tips Before You Begin, Remember: User permissions apply to the owner of the file or directory. Group permissions apply to the members of the group that are assigned to a file or directory. Linux stores group information in the /etc/group file.

Creating a Group and Adding Users to the Group Note: The account studenta5 will be used throughout this lab as an example. 1. Login with the root account. 2. At the command prompt, type: useradd studenta5 passwd studenta5 enter the password when prompted> password123 enter the password again when prompted> password123 3. Now type groupadd Engineering Press Enter. This will create the Engineering group. 4. Verify that the new group has been created by typing: grep Engineering /etc/group The grep command looks for strings of text. In this case, the user asked the grep command to look in the /etc/group file for anything named Engineering. The result is as follows: From the above, a group called Engineering has been created but there is no user attached to it. 5. Next, add a student account to the new Engineering group by typing: usermod G Engineering studenta5 Press Enter. This will add the studenta5 account to the Engineering Group.

6. Verify that user studenta5 has been added to the Engineering group by typing: grep Engineering /etc/group The grep command looks for strings of text. In this case, the user asked the grep command to look in the /etc/group file for anything named Engineering. The result is as follows: From the above, user studenta5 belongs to a group called Engineering. Next we will create a directory for the Engineering group. 7. As the root user, go to the /home directory: cd /home 8. Create a new directory: mkdir Eng 9. Verify that the new directory exists: ls l note that root is currently the owner of this directory 10. Change the ownership of the Eng directory from root to Engineering with the following command: chgrp Engineering Eng 11. Verify that ownership has changed from the root to Engineering: ls l

Now the group has changed to Engineering for the directory called Eng Next we are going to change the permission of the directory called Eng. But before that, note the permission of the directory called Eng as shown below: 12. Change the permissions of the Engineering directory: chmod 771 Eng 13. Verify that permissions of the directory have changed: ls -l

Note: The owner of the Eng directory is the root user. The group is called Engineering Both the root account and the Engineering group have the same Read, Write, and execute permissions. In the last group, everyone has execute privileges only. Creating Files in the Eng Directory 14. Switch users from root to the studenta5 account: If you are studenta5 then ignore this step and go to step 15 su studenta5 15. Go into the Eng directory: cd /home/eng 16. Create a file, type: touch file123 17. Verify that the new file was created: ls l 18. Now switch user to a studenta1 who is not a member of the Engineering group: su studenta1 19. Go to the /home/eng directory: cd /home/eng

20. Create a file: touch grp_file1 You will notice that StudentA1 does not have permission to create the file because it does not belong to the group called Engineering. Deleting the Eng directory 21. Log back in as the root user: su root Enter the password and press Enter. 22. Verify that you are the root user: whoami 23. Go to the /home directory: cd /home 24. Delete the Eng dir and its contents: rm r Eng When prompted to descend into directory Eng, type Y for yes. When prompted to delete the files, type Y for yes. When prompted to delete the directory, type Y for yes.

25. Verify that the Eng directory has been removed: ls l Eng directory is no longer there. Let us now learn how to renaming a Group 26. At the command prompt, type: groupmod n New Engineering Press Enter. This will rename the group from Engineering to New. 27. Verify that the group name changed: grep New /etc/group

Last but not least, we will learn how to delete a Group 28. At the command prompt type: groupdel New Press Enter. This will delete the group. 29. Verify with the grep command: grep New /etc/group The output should not have a group called New.