+ All Categories
Home > Documents > Linux Presentation

Linux Presentation

Date post: 17-Aug-2015
Category:
Upload: muhammad-qazi
View: 6 times
Download: 2 times
Share this document with a friend
Popular Tags:
48
Linux Presentation
Transcript
  1. 1. Linux Presentation
  2. 2. Operating Systems A program that acts as an intermediary between a user of a computer and the computer hardware. Operating systems provide an environment in which a user can execute programs. A program that controls the execution of application programs.
  3. 3. LINUX vs Windows Particular Linux Windows Software Cost Free /Low Costly Easy Easy Easier Reliability More Reliable than windows Required further improvement Sofware Tools Less Numbers but freely More but Cost Hardware driver and user interfaces Few Many Security Very few attacks More vulnerable to Viruses/Attacks Open Source Yes No Support Less Compare to windows Better Support
  4. 4. INTRODUCTION TO LINUX Open Source. Strong Security. Structured File Systems. Multi-User, Multi-Tasking Operating System.
  5. 5. LINUX FILE STRUCTURE In the Linux operating system, all filesystems are contained within one directory hierarchy. The root directory is the top level directory, and all its subdirectories make up the directory hierarchy. This differs to other operating systems such as MS-Windows. All directories are grouped under the root entry "/".
  6. 6. LINUX FILE STRUCTURE... /bin : Important Linux commands available to the average user. /boot : The files necessary for the system to boot. Not all Linux distributions use this one. Fedora does. /dev : All device drivers. Device drivers are the files that your Linux system uses to talk to your hardware. For example, there's a file in the /dev directory for your particular make and model of monitor, and all of your Linux computer's communications with the monitor go through that file. /etc : System configuration files. /home : Every user except root gets her own folder in here, named for her login account. So, the user who logs in with linda has the directory /home/linda, where all of her personal files are kept. /lib : System libraries. Libraries are just bunches of programming code that the programs on your system use to get things done.
  7. 7. LINUX FILE STRUCTURE... /mnt : Mount points. When you temporarily load the contents of a CD-ROM or USB drive, you typically use a special name under /mnt. For example, many distributions (including Fedora) come, by default, with the directory /mnt/cdrom, which is where your CD-ROM drive's contents are made accessible. /root : The root user's home directory. /sbin : Essential commands that are only for the system administrator. /tmp : Temporary files and storage space. Don't put anything in here that you want to keep. Most Linux distributions (including Fedora) are set up to delete any file that's been in this directory longer than three days. /usr : Programs and data that can be shared across many systems and don't need to be changed. /var : Data that changes constantly (log files that contain information about what's happening on your system, data on its way to the printer, and so
  8. 8. SHELLS IN LINUX A shell is a program that provides the traditional, text-only user interface for Linux user interface to the Linux kernel. Its primary function is to read commands that are typed into a console. Types of shells: * Bourne shell (sh) - /bin/sh * C shell (csh) - /bin/csh * TC shell (tcsh) - /bin/tcsh * Korn shell (ksh) - /bin/ksh * Bourne Again SHell (bash)- /bin/bash
  9. 9. Working in the File System Viewing the file system Creating files and Directories Removing files and Directories Linking Files Change Directory List of Files Copy or Move files and Directories Clear Shell Commands Exit, Shutdown & Reboot
  10. 10. Change Directory Change the current working directory to dirName. Ex: cd /usr/scripts cd personal - change the directory into personal. cd .. - Back to the previous directory cd - switch to the previous previous directory 7
  11. 11. BASIC COMMANDS pwd - print current working directory ls - List information about the FILEs. cat - is to read and redirect the output to another file. nano - using nano create a file also to view and edit already created file. vi - using vi create a file also to view and edit already created file. touch - create a simple empty file mkdir - Create one or more directories. cp - Copies files from one location to another within syste.
  12. 12. BASIC COMMANDS (CONTINUE..) rm - Allows the user to remove one or more files and and directories. mv -To change the location of a file, use the mv command. tail - Output the last part of files less - lets an admin scroll through configuration and error log files more - Paginates the specified file so it can be read line by line clear - Clears your screen. exit - The exit causes normal program terminate. logout - Exit a login shell.
  13. 13. Managing File Permissions Setting File Permissions
  14. 14. File Permission (1) In linux user can set file permissions, they are read, write and execute. If the command ls -l is given, a long list of file names is displayed. The first column in this list details the permissions applying to the file.
  15. 15. File Permission (2) Read = 4 Write = 2 Execute = 1
  16. 16. User Administration Create user (useradd name) Delete user (userdel name) Create Group (groupadd name) Delete Group (groupdel name) For password change of any user we can use: passwd username
  17. 17. File System Management in Linux Viewing Diskspace Usage (df or df h) Viewing Space by Files (du or du h) Finding Files
  18. 18. Filesystem Disk Space Usage df - Disk Free Viewing Filesystem usage Viewing Available disk space. Ex: df -h -h - print sizes in human readable format (e.g., 1K, 234M, 2G)
  19. 19. Viewing Diskspace by Files du - Disk Usage du (i.e., disk usage) command reports the sizes of directory trees inclusive of all of their contents and the sizes of individual files. Ex: (1) du /sbin/file1 (2) du -h /home
  20. 20. Finding Files grep (Grand Regular Expression) The grep command searches one or more input files for lines containing a match to a specified pattern. Ex: (1) ls /usr/scripts/ | grep payel This searches for pattern specified.
  21. 21. Finding Files (2) find Used to locate files on a Unix or Linux system. Search any set of directories you specify for files that match the supplied search criteria. Ex: (1) find / -name otrs finds the file or directory named otrs
  22. 22. Process Management in Linux Viewing Running Services and Runlevel Viewing Running Process Killing a Running Process
  23. 23. Viewing Running Process (1) top Provides an outgoing look at processor activity and update dynamically. Listing of the process based on CPU usage Memory usage Runtime. Can monitor process belongs to the specific process id.
  24. 24. Viewing Running Process (2) ps Enumerates the currently running processes. Process are identified by its id (pid). List the Process with its id, state, usage too. Ex: (1) ps au a - lists all process u - select by effective user-id
  25. 25. Viewing Running Process (3) We can combine ps with grep to find a process by name. Ex: (1) ps aux | grep httpd Lists the process whose name is httpd. List the Process with its id, state, usage too.
  26. 26. Viewing Running Process (4) Pidof shows the process id of a running process Ex: pidof httpd Lists the process ids of httpd process
  27. 27. Kill a Running Process ps is most often used to obtain the PID. using pid kill/terminate a unintended process. if the PID of a program is found to be 1125 combine ps with grep to find a process by name. Ex: kill process-id (1) Kill -9 1125
  28. 28. Basic Networking Commands ifconfig (to view network config) ping (same as window) netstat (gives interface statistics) (-pant will display open ports)
  29. 29. Shell and Remote Copy Secure Shell (ssh) Secure Copy
  30. 30. Secure Shell ssh Allows logging into remote machine Provides secure encrypted communications Must need an identity Ex: ssh username@ip-address (1) ssh [email protected]
  31. 31. Secure Copy scp scp copies files between hosts on a network. use ssh for data transfer provides security as ssh. scp will ask for passwords for authentication. Ex: scp /backup [email protected]:/backup
  32. 32. man man is the systems manual pager. Each page argument given to man is normally the name of a program, utility or function. The manual page associated with each of these arguments is then found and displayed. A section, if provided, will direct man to look only in that section of the manual. The default action is to search in all of the available sections, following a pre-defined order and to show only the first page found, even if page exists in several sections.
  33. 33. PACKAGE INSTALLATION Install packages from source The installation procedure for software that comes in tar.gz and tar.bz2 packages isn't always the same, but usually it's like this: # tar -xvzf package-name.tar.gz # cd package-name # ./configure # make # make install
  34. 34. PACKAGE INSTALLATION wget $ wget http://ftp.otrs.org/pub/otrs/RPMS/fedora/4/otrs-3.1.10- 01.noarch.rpm rpm rpm -ivh otrs-3.1.10-01.noarch.rpm yum yum mysql
  35. 35. YUM REPOSITORIES at /etc/yum.repos.d enables to directly download and update packages CPAN is also a tool for package installation
  36. 36. Server Apache Webserver OpenSSH Server FTP Server
  37. 37. APACHE SERVER Web server Fully open source Developed by Apache Software Foundation Directives that control the configuration of Apache. Secure Sockets Layer. main config. file at nms is /etc/httpd/conf/httpd.conf
  38. 38. OpenSSH Server Secure Shell or SSH is a network protocol that allows data to be exchanged using a secure channel between two networked devices. Ex: 1. ssh user@host 2. ssh -p user@host - connect to host on port as user.
  39. 39. FTP SERVER FTP (File Transfer Protocol) is the simplest and most secure way to exchange files over the Internet.
  40. 40. FTP CONNECTION E.G We can get/put files from and to the nms2 Also mget/mput for several files can be used
  41. 41. FTP CONNECTION E.G 2 We can change directories by cd also.
  42. 42. MRTG Data Transfer from all SBSs to NMS using FTP Data Used through scripts in /usr/scripts/ Result of these scripts is processed through MRTG main script at /etc/nocnms/nocnms resulting three files Php, html, and log files created
  43. 43. MRTG (CONTINUE ..) These created files are placed at /var/www/html/noc1/ As in the main appache server file (i.e at /etc/httpd/conf/httpd.conf) nms.bhaoo.com is assigned to the directory /var/www/html/noc1 Also demoFramesetNodes.js file at var/www/html/noc1enables us to break into nms.bhaoo.com directory
  44. 44. OTRS Ticketing system. Open source and well documented on web Infinite option to optimize as per our requirement
  45. 45. INSTALLATION BRIEF #setenforce 0 # yum install mysql-server mysql php-mysql #service mysqld start # /usr/bin/mysql_secure_installation #$ wget http://ftp.otrs.org/pub/otrs/RPMS/fedora/4/otrs- 3.1.10-01.noarch.rpm #rpm -ivh otrs-3.1.10-01.noarch.rpm # service httpd restart
  46. 46. Q/A SESSION
  47. 47. Thank you

Recommended