VI & VIM: POWERFUL EDITING

• VI

was originally released in 1976 by Bill Joy for BSD UNIX proprietary and open-source version of VI

• Both • VIM

(VI iMproved) released in 1991; enhanced for programmers commands do many special things: delete an entire line; ‘20dd’ will delete 20 lines delete an entire word; ‘5dw’ will delete 5 words will replace all instances of ‘this’ with ‘that’

• Keyboard • ‘dd’ will • ‘dw’ will

• :s/this/that/g • Extremely

common (vi or vim) on most UNIX-like OSs

BASIC FILESYSTEM SECURITY
• Provide • Root

files and directories with the least required permission

only gets ‘write’ permission on major system files allow access to your home directory to others

• Don’t • Set

User ID & Set Group ID must be used sparingly

• Provides

the file execution by the owner or group the file is assigned to. Great for files that need privileges that the user executing the file doesn’t have access to - Allows for root access to the password files without giving the user access because of SUID access

• /usr/bin/passwd

UNIX FILE PERMISSIONS
Permission Read Write Execute Alpha r w x Octal 4 2 1

Sets Permissions Groups -rwxrwxrwx File: Read, Write, Execute Everyone -r-xr-x--Owner, Members File: Read, Execute drw----rw- Directory: Read, Write Owner, Others

Permission sets for files and directories are for three groups: •Group 1: Owner •Group 2: Group Members •Group 3: Other

User Group Other
Octal 777 550 606

WHAT DOES IT DO?

CHMOD UG+R

OWNER: ADD READ GROUP: ADD READ OTHER: NO ACTION

CHMOD 755

OWNER: READ, WRITE, EXECUTE GROUP: READ, EXECUTE OTHER: READ, EXECUTE

CHMOD 100

OWNER: EXECUTE GROUP: NONE OTHER: NONE

file1

HARDLINK

file2

HARD DISK SPACE

file1

SOFTLINK

file2

HARD DISK SPACE