Commands are in black

Similar documents
Chapter Two. Lesson A. Objectives. Exploring the UNIX File System and File Security. Understanding Files and Directories

CSCI 2132 Software Development. Lecture 4: Files and Directories

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

CS/CIS 249 SP18 - Intro to Information Security

Unix Filesystem. January 26 th, 2004 Class Meeting 2

5/8/2012. Creating and Changing Directories Chapter 7

Unix File System. Class Meeting 2. * Notes adapted by Joy Mukherjee from previous work by other members of the CS faculty at Virginia Tech

Linux Kung Fu. Stephen James UBNetDef, Spring 2017

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

Session 1: Accessing MUGrid and Command Line Basics

Lab 2A> ADDING USERS in Linux

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

Linux Essentials. Programming and Data Structures Lab M Tech CS First Year, First Semester

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

Linux Kung Fu. Ross Ventresca UBNetDef, Fall 2017

CST Lab 2 Review #1

Introduction. What is Linux? What is the difference between a client and a server?

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

Files and Directories

Getting your department account

CS246 Spring14 Programming Paradigm Notes on Linux

Overview of the UNIX File System

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

CSE 303 Lecture 2. Introduction to bash shell. read Linux Pocket Guide pp , 58-59, 60, 65-70, 71-72, 77-80

INTRODUCTION TO LINUX

Introduction to Linux

CS197U: A Hands on Introduction to Unix

CS Fundamentals of Programming II Fall Very Basic UNIX

Overview of the UNIX File System. Navigating and Viewing Directories

Chapter-3. Introduction to Unix: Fundamental Commands

CENG 334 Computer Networks. Laboratory I Linux Tutorial

Working with Basic Linux. Daniel Balagué

A Brief Introduction to Unix

Linux Essentials Objectives Topics:

You will automatically be in your user (home) directory when you login.

Operating Systems. Engr. Abdul-Rahman Mahmood MS, PMP, MCP, QMR(ISO9001:2000) alphapeeler.sf.net/pubkeys/pkey.htm

Perl and R Scripting for Biologists

Lab Authentication, Authorization, and Accounting

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

Student Remote Login Procedure (see picture below): 1. Start SSH Secure Shell 2. Click the computer icon (4 th on the toolbar) 3.

Introduction to Linux

Introduction to Unix: Fundamental Commands

Users, Groups and Permission in Linux

THE HONG KONG POLYTECHNIC UNIVERSITY Department of Electronic and Information Engineering

Files

Introduction to UNIX command-line

CSE115 Lab exercises for week 1 of recitations Spring 2011

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]

Basic Unix Command. It is used to see the manual of the various command. It helps in selecting the correct options

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

Oxford University Computing Services. Getting Started with Unix

Unix File System. Learning command-line navigation of the file system is essential for efficient system usage

ADVANCED LINUX SYSTEM ADMINISTRATION

1 Getting Started with Linux.

User & Group Administration

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

Introduction of Linux

Mills HPC Tutorial Series. Linux Basics I

Introduction to the Linux Command Line

Operating Systems. Copyleft 2005, Binnur Kurt

CST8207: GNU/Linux Operating Systems I Lab Ten Boot Process and GRUB. Boot Process and GRUB

Linux at the Command Line Don Johnson of BU IS&T

Linux Kung-Fu. James Droste UBNetDef Fall 2016

Operating Systems 3. Operating Systems. Content. What is an Operating System? What is an Operating System? Resource Abstraction and Sharing

Linux & Shell Programming 2014

GNU/Linux 101. Casey McLaughlin. Research Computing Center Spring Workshop Series 2018

Unix Tutorial Haverford Astronomy 2014/2015

Computer Systems and Architecture

CS 215 Fundamentals of Programming II Spring 2019 Very Basic UNIX

Linux Shell Script. J. K. Mandal

The UNIX Operating System. HORT Lecture 2 Instructor: Kranthi Varala

Introduction to Linux (Part I) BUPT/QMUL 2018/03/14

Getting started with Hugs on Linux

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

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

Introduction Into Linux Lecture 1 Johannes Werner WS 2017

Course 144 Supplementary Materials. UNIX Fundamentals

Examples: Directory pathname: File pathname: /home/username/ics124/assignments/ /home/username/ops224/assignments/assn1.txt

Getting started with Hugs on Linux

EECS Software Tools. Lab 2 Tutorial: Introduction to UNIX/Linux. Tilemachos Pechlivanoglou

UNIX Tutorial One

Week Overview. Unix file system File types and file naming Basic file system commands: pwd,cd,ls,mkdir,rmdir,mv,cp,rm man pages

This is Lab Worksheet 3 - not an Assignment

Crash Course in Unix. For more info check out the Unix man pages -orhttp:// -or- Unix in a Nutshell (an O Reilly book).

Lab Working with Linux Command Line

h/w m/c Kernel shell Application s/w user

1 Installation (briefly)

1. Open VirtualBox and start your linux VM. Boot the machine and log in with the user account you created in Lab #1. Open the Terminal application.

Std: XI CHAPTER-3 LINUX

Introduction to Linux Workshop 1

Systems Programming and Computer Architecture ( ) Exercise Session 01 Data Lab

Practical Session 0 Introduction to Linux

LAB 8 (Aug 4/5) Unix Utilities

commandname flags arguments

Using RANCID. Contents. 1 Introduction Goals Notes Install rancid Add alias Configure rancid...

Basic UNIX commands. HORT Lab 2 Instructor: Kranthi Varala

Everything about Linux User- and Filemanagement

Full file at

Introduction to Unix - Lab Exercise 0

Embedded Linux Systems. Bin Li Assistant Professor Dept. of Electrical, Computer and Biomedical Engineering University of Rhode Island

Transcription:

Starting From the Shell Prompt (Terminal) Commands are in black / +--------+---------+-------+---------+---------+------ +------ +------ +------ +------ +------ +-- Bin boot dev etc home media sbin bin lib usr var tmp Test2 Above is a view of a typical Linux file structure from the root (/) Getting help The man command allows you to view manual pages in Linux just like F1 in Windows. Please make note of the following when issuing the man command or any other command that has one page per screen displayed at a time. Enter or up and down arrow allows you to scroll, space bar allow you to scroll one screen (page) at a time and q allows you to quit. 1. In the terminal window enter the following command and then press Enter 1 Property of Paul Warner

2. What is displayed? 3. In the terminal window enter the following command 4. What does this command do? Hint look at the description 5. In the terminal window enter the following commands and then look at the top of the page? What do you see is the difference? and then 6. The following other command can also be used to get help ( ) for example. For more practice issue these other commands Using the su (switch user) command Before you begin this lab create a user called jack. Remember Linux is case sensitive 2 Property of Paul Warner

Exercise 1-1 1. Create a user called jack 2. Switch to the use jack 3. What prompt is displayed? 4. Switch back to the root user, you must enter the root password 5. What prompt is displayed? 6. Type the command below 7. What happened? Switch back to user jack Displaying the Date and Time Using the table below issue the command that is in bold. For example Take note of what happens Issue the following commands date 101909302010 Explanation Changing the date and time 3 Property of Paul Warner

date date +%A %B %d %G date +Today is %F date - -date= 6 weeks date - - date= 5 months date - - date= 5 months 5 days date - - date= 25 Dec +%A Displays current date, time and time zone Display day, month, day of the month, year Add word to the date output Display date 6 weeks from today Display date 5 months from today Display date 5 months and 5 days from today Display the date Christmas falls on User Information Using the table below issue the command that is in bold. Note the $ represents the prompt, you do not have to type it. Commands Description $last List the most recent successful logins $last a Makes it easier to read $lastb List the most recent unsuccessful logins $who List who is currently logged in $who u Same as who command but in long format $users Same as who but in short format $id Gives your identity $whoami Same as who $w Give more details about who is logged in $finger Display a list of users logged into the system $finger s jack Give user information short $finger l root Give user information in long format Absolute and Relative Path Absolute path begins from the root (/) or starts from the root of the file system. If you will be writing the absolute path the following must be adhered to: Start at the root directory ( / ) and work down. Write a slash ( / ) after every directory name (last one is optional) 4 Property of Paul Warner

For example What is the absolute path to the etc/apt folder Note when issuing a command with the absolute path location is not relevant. Relative Path Relative path start with your present working directory (pwd) or you current directory(present location). For example the relative path for is the apt folder. Exercise 1-2 1. Clear your screen, what command did you use? 2. Type the command 3. Type what is your absolute path? 4. Install the tree command in Kali. Type the command below, the clear the screen. We will be using this command later 5 Property of Paul Warner

User and Group Management You will have ability to create users and groups What is used to create users Remember we are working with Kali but all distributions use the useradd command You can also use the Example: Task 1:1 Listing users and groups: Fill in at least 3 username and other information User Login Name User Full Name Room Location of User Group User is a Member of robertp Robert Phillips Tech 211A faculty student student security 6 Property of Paul Warner

Task 2: Creating the users Using the adduser command create the user in Task 1:1 Task 3: Creating Groups Two commands can be used to create groups: and Finish creating the security group 7 Property of Paul Warner

Task 4: Adding user to Groups Adding the users to groups Add the other users to their respective groups Task 5: Verifying and looking at User and Groups configuration files Default user settings Stores user information Stores group information Stores password information in encrypted form /etc/login.defs /etc/passwd /etc/group /etc/shadow Fields in the /etc/passwd file User name robertp Encrypted password x User ID number (UID) 1005 User's group ID number (GID) 1005 Full name of the user Robert Phillips User home directory /home/robertp Login shell /bin/bash 8 Property of Paul Warner

Fields in /etc/shadow: 1. username: 2. encrypted_password: Review the file for other options check the internet Now logout and login as robertp 9 Property of Paul Warner

Task 6: Understanding Present Working Directory 1. Go to the shell prompt. What is your shell prompt 2. Type pwd. What is your present working directory 3. Enter the command: cd ~ What is your current directory now? 4. Your current directory is /home/robertp You enter the command: cd What is your current directory now? 5. Your current directory is /home/robertp You enter the command: cd.. What is your current directory now? 6. Your current directory is /home/robertp You enter the command: cd / What is your current directory now? 10 Property of Paul Warner

Task 7: Listing Directory Contents and Navigating the file system Understanding files and folders The ls command is used to show the contents of a directory. When the content of the directory is shown it is important to note: Black represents a file Red represents backup or zip files Blue represents a folder Green represents executable File and directory that begin with a period (.) are hidden. ls List the contents of the current directory ls /home List the contents of the /etc directory ls -a Displays all entries in the current directory including those that are hidden. ls -l Display a long or detailed listing of the current directory, one line of data for each entry. ls -al /home Display a long listing of the /etc directory including "hidden" files or subdirectories. ls -t Files are sorted by date modified. ls -tr Files are sorted by date modified in reverse order ls -F Shows a character after every entry. Executables (*), directories (/), FIFO (I), symbolic link (@). ls -R Output is recursive, including all subdirectories ls -u Sorted by date of last access. Remember these commands pwd - print working directory cd - change directory 11 Property of Paul Warner

You must fill in the commands that allow you to complete the task A sample directory entry: d This is an directory rwx The permissions for the owner (robertp): read, write, execute r-x The permissions for the group (robertp): read, no write, execute r-x The permissions for others: read, not write, execute 15 The number of links to the file robertp The owner robertp The group 4096 The size (in bytes) Sep 13 01:58 The last time that the file was modified 1. Change to the root of the file structure? 2. List at least 2 folders in this directory 3. Change to robertp home directory 4. List at least two folders in this directory 5. Change to the /etc from your current location( remember absolute path) 6. Change to the /bin directory from your current location 7. View the content of the /home directory from your current location 8. View the content of the /sbin directory from your current location 9. Do you have hidden files in the /home/robertp folder 10. Do you have any executable files in the /etc folder 11. Do you have any links in the /sbin folder 12 Property of Paul Warner

Task 8: Creating and working with Directories Switch to the root user mkdir - This command creates a new directory. Examples: mkdir test mkdir /etc/test123 rmdir -This command removes an existing directory. The directory must be empty before it can be removed. Example: rmdir test rm rf test This removes a directory but it must be empty This removes a directory and everything within it Create the following folder Structure 1. Go to the home folder of robertp and create a folder call parent 2. Inside the parent folder create the following structure below. 13 Property of Paul Warner

14 Property of Paul Warner