480 likes | 668 Views
Welcome to Securing Linux Intro to Linux. WK 1 Objectives. Syllabus Intro to Linux ppt Basic commands, Directory structure, & File permissions Remotely log into the Linux network Class Project, Homework. Course Text. Additional Linux Books. Distro types.
E N D
WK 1 Objectives Syllabus • Intro to Linux ppt • Basic commands, Directory structure, & File permissions • Remotely log into the Linux network • Class Project, Homework
Distro types • Installable versions installed to a disk • Live versions – bootable cd /dvd • VirtualBox – is a virtual engine you can run Linux under VB on windows • Unetbootin – • utility to make a bootable usb key • Embedded versions - DSL embedded Download to windows runs on top of windows in a virtual session
GNU • 1973 Richard Stallman proposed the idea of a free Unix, started the GNU project • Started the Free Software Foundation and formulated the General Public License (GPL) • Hackers began assisting on projects • Became know as the Open Source Movement
Question? • What does Open Source mean to you?
Linux Highlights • Based on TEXT! Everything treated as a file! • ONE Hierarchical file system verse many in Window & DOS • Security, file attributes, users groups, privileges, permissions, etc • Multi-processing • Safe, Stable & Strong!
What is Linux • Short answer = like UNIX • Long answer = a REVOLUTION
Linux is like UNIX ... So, what is UNIX? • developed by Ken Thompson at Bell Labs in 1969 • was joined Dennis Ritchie (founder of C language) • MULTICS had a strong influence on UNIX • Ran on PDP-7, PDP-11 • Both completely rewritten in 1973 using the C programming language (making it portable) • due to legal issues, UNIX could not be sold – so AT&T distributed it to educational and research communities • once the legal issues were settled, several commercial versions appeared • http://plan9.bell-labs.com/who/dmr/
UNIX • a true multi-user and multi-tasking environment • designed by programmers for programmers • small enough to understand, algorithms based on simplicity, kernel, shell, and library structure is easily expandable yet powerful • UNIX was intimately involved with the development of the Internet • UNIX erred regarding the desktop PC market • Could be as bad as IBM & Microsoft blunder
Unix’s strength • Logical Volume Manager (LVM) • Low Cost, Simple, Stable, Scalable, Customizability, Minimalistic and Purpose-built • Internet subset of tools • TCP/IP • FTP • Rlogin Slogin • Send Mail • Telnet
LINUX kernel • In 1991 Linus Torvalds a student rewrote the UNIX kernel and publish it on the Internet (Minix) • His instructor said it would never take off • Small kernel ran on Intel’s 386 (32-bit cpu) • GNU Libraries + Linux kernel = Full functional operating system • The rest is history!
Linux kernel Poster • http://www.linuxdriver.co.il/kernel_map_poster
Pro’s • $$$$$$$$ FREE $$$$$$$$$$ • TCP/IP subset = Internet • LVM • Low Cost, Simple, Stable, Scalable, Customizability, Minimalistic and Purpose-built • Supports many file systems • Portable – runs on gas pumps • Transferable to routers, sans, PDA’s, Phones, etc • Example: Google’s 450,000 RedHat servers • Open Source more Secure?
Con’s • Too Many Variant's (maybe 315)???? • Welcome to the dark side • Concurrence not yet there in driver package. • Open Source less Secure?
Distributions • Red Hat most popular • SuSE most popular in Europe • Debian most popular with hackers • Standard $30-$50 • Professional $60-$100 • Enterprise $100-$200 • Linux is FREE! You pay for distribution integration the OS, software & support
Linux kernel • Numbering conventions • Even stable 2.0, 2.2, 2.4, 2.6 • Developmental 2.1, 2.3, 2.5, 2.7
CLI • Like DOS • [doSomething] [how] [toFiles] • [doSomething] [how] [sourceFile] [destinationFile]
Redirection • [doSomething] [how] < [inputFile] > [outputFile]
Piping • [doSomething] [how] | [doSomething] [how] | [doSomething] [how] > [outputFile]
Tricks • Wildcards : * and ? • >> redirect to append file
Consoles • Terminals emulators = xterm, konsole, etc • Virtual terminals • [alt]-[F1], … [alt]-[F6], [alt]-[F7] is GUI • [ctrl]-[alt]-[F1], … [ctrl]-[alt]-[F6] from GUI to Virtual terminal • Exiting Linux • [main menu] - [logout] from KDE • Exit or [ctrl]- D from text mode
Getting Help • man command • info command • −−help (command --help)
Pathing • [/] forward slash means from root dir • [/] = absolute pathing • [.] means current directory • [..] means parent directory • [./] explicitly means look here!
GUI desktops • CDE : Common Desktop Environment, commercial • KDE: K Desktop Environment utilities begin with “k” or “kde” • GNOME: GNU Network Object Model Environment, utilities begin with “g” or “gnome”
Distribution Installation • SuSE utilizes YAST: Yet Another Software Tool • Red Hat utilizes RPM: Red Hat Package Manager • Debian utilizes dpkg: Debian Package Manager
users and groups • users are identified in the file /etc/passwd • user name and user id (uid) • groups are identified in the file /etc/group • group name and group id (gid) • important linux commands: • display uid and gids id
users and groups • root user uid = 0 • regular user uid >= 500 ? • system user 0 < uid < 500 • typically runs daemons (services) • does not login
users and groups • root user / system administrator / superuser • limit time as root user • it is too easy to do great damage! • example: rm -r * • becoming root user • at login • su (switch user) command
users and groups • regular user • unique account for each user • specify a default home directory • example: /home/joecool • specify a default shell • example: /bin/bash
users and groups • system user • typically does not require a home directory • typically does not require a default shell • a secure system should reflect this • /etc/passwd
users and groups groups represent collections of users having common needs an individual user may belong to several groups groups
users and groups • as a general rule: if a user requires access to certain files and/or to certain devices, then • it is better to add the user to the group that is permitted access than to modify the file access rights
file access rights • the following command is essential in UNIX • ls -l • read – write – execute triples r w x • user – group – other triples u g o • chown command • chgrp command • chmod command
file access rights • octal notation is least ambiguous • read r 4 • write w 2 • execute x 1 • example: • rwx r-x r-- equivalent to 7 5 4 octal
file attributes • file attributes are an extension to file access rights • limited to linux native file systems: ext2 and ext3 • basic commands: • to display attributes • lsattr • to set or modify attributes • chattr
file attributes • important attributes: • immutable +i • can not be modified, deleted, renamed, nor linked to • ideal for system files • append +a • only additions at the end of the file are permissible • ideal for log files • scrub +s • all blocks zeroed out when deleted