1 cs3695 network vulnerability assessment risk mitigation introduction to unix linux

Download 1 CS3695  Network Vulnerability Assessment  Risk Mitigation  Introduction to Unix  Linux

If you can't read please download the document

Upload: penelope-hardy

Post on 18-Jan-2018

220 views

Category:

Documents


0 download

DESCRIPTION

3 Linux/Unix What you should know –Linux/Unix commands are arcane and cryptic and often silly looking –Linux command are case sensitive! –Some commands have flags for additional optional control like this: …ls -al or rm -r –You can put multiple commands on the same line: …ls ; pwd –You can auto-complete commands with the tab key –You can correct a bad command with ^^

TRANSCRIPT

1 CS3695 Network Vulnerability Assessment & Risk Mitigation Introduction to Unix & Linux 2 Know basic Linux commands, such as: ls, cd,|, more, mkdir, rmdir, touch, rm, cp, su, vi, chmod, w, who, finger Know commands are case sensitive Know the difference between ssh and telnet Introduce vi as an editor Know how permissions work Objectives 3 Linux/Unix What you should know Linux/Unix commands are arcane and cryptic and often silly looking Linux command are case sensitive! Some commands have flags for additional optional control like this: ls -al or rm -r You can put multiple commands on the same line: ls ; pwd You can auto-complete commands with the tab key You can correct a bad command with ^^ Linux Distributions Linux Live CD-ROMs A LiveCD is an operating system (usually containing other software as well) stored on a bootable CD-ROM that can be executed from it, without installation on a hard drive Knoppix Live CDs are widely used in the Linux community It is completely customizable Source:Copyright by EC-Council EC-Council 6 Connecting to Linux You can telnet or ssh if you want 7 You can get help with the man man for manual pages Working with Man man [command] Within man: spacebar/f = forward b = back q = quit / = search forward ? = search backward n = repeat search 8 Reading Files 9 10 Linux ls You can list directories with ls 11 More on ls Permissions Ownership And group membership Size Date of last Mod Time or year of last Mod Filename Text # of Links First Bit - = file l = link d = directory b = block device (disk drive) c = character device (serial port or terminal) 12 Ownership and Permissions Three levels of ownership and permissions User Group Everyone Within these groups you can specify permissions: Read Write execute File access levels Permissions 13 Who owns what? 14 Change the group association of files and directories chgrp chgrp R To change the group association of a directory and all of its contents us the R switch 15 You can change ownership! chown chown R The R switch again 16 Change permissions 17 Or Use chmod Or use the chmod command to set the individual levels: --- 7=rwx, 3=-wx, 1=--x 18 Change directories with cd and find yourself with pwd You can change directories and find yourself cd to change directory, pwd to display your current directory 19 You can Pipe I/O | and more = one screen at a time 20 The redirect > It doesnt have to go to the screen. 21 You can make a directory with mkdir mkdir creates directory 22 You can touch Make a file with touch 23 You can copy cp is used to copy a file 24 You can move files and directories mv is used to move (or rename) a file 25 You can remove files and directories rm and rmdir You must remove everything from the directory to use rmdir 26 What about that shell? Common Unix shells Sh: This shell, the original, often called the Bourne shell, not too flexible, great for scripting Csh and tcsh: The family of shells adds great interactive uses but discards the popular scripting support that sh offers. It favors C programming like type syntax Ksh, bash, zsh: These provide a good mix of scripting and interactive capabilities, bash is very similar to sh and is often referred to as Bourne again shellhence bash 27 What is my shell? Echo $shell 28 I think you should change your identity su: substitute user When: to log in as a different user or to start a new login shell To login as a different user su asr To start a new login shell su rharkins {the hyphen will force a new login shell} To return to the previous shell exit Use su without anything else to get to root (you will be prompted for the root password) su To perform a single task as root use sudo sudo tcpdump 29 What editor should I use VI: Powerful but very cranky editor. It is universally available, and therefore a good reason to learn it at some time. Literally no help while in the editor so you just have to know it. Two modesinput and commandget used to it. You could man vito read help 30 VI Notice all the nice help you get in this editor! 31 Some VI Help One command to help with vi As soon as you open vi, use the command :set showmode This displays which mode you are in USE THE vi Cheat Sheet! 32 33 Other Editors PICO: One of the newer UNIX/LINUX editors. Popular because it is easy to use. Usually ships with the pineprogramso if you have pine you should have PICO. 34 PICO Much better huh? 35 System info The uname command 36 To snoop with who, w, finger Who is logged on to system grep is Your Friend grep searches the named input FILEs for lines containing a match to the given PATTERN. By default, grep prints the matching lines grep grep host zone.txt 37