You are on page 1of 225
Syllabus Course: TOPICS (Credits : 03 Lectures/Week:03) USCS502 : Linux Server Administration Objectives: Demonstrate proficiency with the Linux command line interface, directory & file managemen, techniques, file system organization, and tools commonly found on most Linux distributions ent to integrate with exi, Effectively operate a Linux system inside of a network environ service solutions. Demonstrate the ability to troubleshoot challenging technical problems typically ms, encountered when operating and administering Linux syst Expected Learning Outcomes: Leamer will be able to develop Linux based systems and maintain, Learner will be able to instal} have proficiency in Linux appropriate service on Linux server as per requirement. Leamer wil server administration. Unit Details Lectures 1 | Introduction: Technical Summary of Linux Distributions, Managing Software Single-Host Administration: Managing Users and Groups, Booting and shutting down processes, File Process of configuring, compiling, Linux 15 Systems, Core System Service: Kernel Networking and Security: TCPAP for System Administrators, basic network Configuration, Linux Firewall (Netfilter), System and network security (Refer chapter 1) II | Internet Services: Domain Name System (DNS), File Transfer Protocol (FTP), Apache web server, Simple Mail Transfer Protocol (SMTP), Post Office Protocol and 15 Internet Mail Access Protocol (POP and IMAP), Secure Shell (SSH), Network Authentication, OpenLDAP Server, Samba and LDAP, Network authentication system (Kerberos), Domain Name Service (DNS), Security (Refer chapter 2) a (Book Code : MCO20A) Unit Details Lectares ML | Intranet Services: Network File System (NFS), Samba, Distributed File Systems (DFS), Network, Information Service (NIS), Lightweight Directory Access Protocol (LDAP), | 5 Dynamic Host Configuration Protocol (DHCP), MySQL, LAMP Applications File Servers, Email Services, Chat Applications, Virtual Private Networking. (Refer chapter 3) Qa (Book Code : MCO20A) Lab Syllabus USCSS502: Linux Server Administration Practical shall be performed using any Linux Server (with 8GB RAM). ~ Internet connection will be required so that Linux server (command line mode) can he connected to Internet. 1. Install DHCP Server in Ubuntu 16.04 2. Initial settings: Add a User, Network Settings, Change to static IP address, Disable 1Pv6 jj not needed, Configure Services, display the list of services which are running, Stop ang tum OFF auto-start setting for a service if you don’t need it, Sudo Settings 3. Configure NTP Server (NTPd), Install and Configure NTPd, Configure NTP Client (Ubuntu and Windows) 4. SSH Server : Password Authentication Configure SSH Server to manage a server from the remote computer, SSH Client : (Ubuntu and Windows) 5. Install DNS Server BIND, Configure DNS server which resolves domain name or IF address, Install BIND 9, Configure BIND, Limit ranges you allow to access if needed. 6. Configure DHCP Server, Configure DHCP (Dynamic Host Configuration Protocol) Server, Configure NFS Server to share directories on your Network, Configure NFS Client. (Ubuntu and Windows Client OS) 7. Configure LDAP Server, Configure LDAP Server in order to share users’ accounts in your local networks, Add LDAP User Accounts in the OpenLDAP Server, Configure LDAF Client in order to share users' accounts in your local networks. Install phpLDAPadmin te operate LDAP server via Web browser. 8. Configure NIS Server in order to share users’ accounts in your local networks, Configure NIS Client to bind NIS Server. 9. Install MySQL to configure database server, Install phpMyAdmin to operate MySQL or web browser from Clients. 10. Install Samba to share folders or files between Windows and Linux. | Book Code: MCO20A) W tinux Server Admin. (MU B.Sc. COMP - Sem-V)_1 ‘Tale of Contathe ei bimux Server Admin (ME BS Abo of Contents UNIT. > Chapter 1: Intranet Services 1-1 to 1-65 ¥ Syllabus Topic : Technical Summary of Linux Distributions... Lt Ll Technical Summary of Linux Distributions. 1.1.1 Linux : The Operating System ... 1.1.2 Open Source Software and GNU..... 1.1.3 GPL: General Public License. 1.14 Advantages and Disadvantages of Open Source Software 1.1.5 Understanding the Differences between Windows and Linux.. v Syllabus Topic : Managing Software.. 12 Managing Software ..... 12.1 The RPM Package Manager 1.2.2 The Debian Package Management System . 1.2.2.1 APT... 1.2.3 Managing Software Using RPM 1.2.3.1 Querying for Information the RPM Way .. 1.2.3.2 Installing with RPM (Moving In Together) 1.2.3.3 Uninstalling Software with RPM (Ending the Relationship). 1.2.4 — Software Management in Ubuntu.. 1.2.5 GUIRPM Package Managers 1.2.6 Compile and Install GNU Software .. v Syllabus Topic : Managing Users and Groups 1.3. Managing Users and Groups 1.3.1 Definition of User. 1.3.1.1 The /etc/passwd File 1.3.1.2. The etc/shadow File 1.3.1.3 The /etc/group File . 1.4 User Management Tools 1.4.1 Command line Interface of Contents Ke \ and ReiserFS... ng Files Systems.. b \ing and Unmounting Local Disks.. e ' 1g the mount Command. File Systems... The Init Daemon... 16.1.1 The /etc/inittab File . (6.1.2 The telinit Command... 16.2 Xinetd and Inetd... /1,16.2.1 The /etc/xinetd.conf Fil 1.16.3 The Logging Daemon... 1.16.1 Invoking rsyslogd 1.16.4 Configuring the Logging Daemon . 1.16.4.1 Log Message Classifications 1.16.42 Format of /etc/rsyslog.conf.. 1.17 The Cron Program... L171 The crontab File. 1.17.2 - Editing the crontab File Y Syllabus Topic : Process Of Configuring, Compiling Linux Kernel... 1-32 118 Process of Configuring, Compiling Linux Kernel .. 1.18.1 What Exactly is a Kernel ?.. Table of Contents 14.1.2 usermod -.. 1413 Userdel.. 14.14 Groupadd.. 14.15 Groupdel — 113 14.16 Groupmod... 1-13 142 GUTUser Managers... 113 15 Users and Access Permissions ... 1-14 16 —Pluggable Authentication Modules (PAM).. 1g 161 Working of PAM... 14 Lis a Syllabus Topic : Booting, Shutting Down and File Systems. 17 Booting, Shutting Down and File Systems 1.7.1 Boot Loaders 17.11 GRUB. 1.7.12 LILO. 1.7.13 Bootsrapping .. 18 The Init Process... 19 RC Scripts. 19.1 Creating the carpald.sh Script... 192 Creating the Stamp Script. 1.10 Enabling and Disabling Services.. 1.10.1 Disabling a Service... 1.11 Odds and Ends of Booting and Shutting Down... L112 Booting into Single-User (“Recovery”) Mode. “ Syllabus Topie : Files System LI2 Files Systems. LI21 The Makeop of File Synems. LIZLI PNodes —_____. LI212 Seperblocks — W Linux Server Admin, (MU B.Sc. COMP - Sem-V) oe 1.12.13 1.13 113.1 113.11 1.13.12 1.13.13 1.13.2 1.13.3 Lis 114.1 1.14.2 115 1.16 1.16.1 1.16.1.1 1.16.1.2 1.16.2 1.16.2.1 1.163 1.16.3.1 1.16.4 1.16.4.1 1.16.4.2 17 LITA 1.17.2 118 1.18.1 ext3 and ReiserF! oh-23 Managing Files Systems. 12 Mounting and Unmounting Local Disks 1-23 Using the mount Command... 144 Unmounting File Systems 12 The /etc/fstab File... 124 Using fsck... 1-4 Adding a New Disk Volume Management Terms Creating Partitions and Logical Volumes... Creating File Systems. Syllabus Topic : Core System Services .. Core System Services... ‘The Init Daemon.. The /etcfinittab File The telinit Command Xinetd and Inetd.... The fetc/xinetd.conf File. ‘The Logging Daemon Invoking syslogd Configuring the Logging Daemon .. Log Message Classifications Format of /etc/rsyslog.conf... ‘The Cron Program.. 1a The crontab Fil mae) Editing the crontab File . 13 Syllabus Topie : Process Of Configuring, Compiling Linux Kernél..... 1.33 Process of Configuring, Compiling Linux Kernel L133 What Exactly is a Kernel ?.. 1:33 WD Linux server Admin, (MU B.Sc. COMP - Sem-V) Table of Contents 1.18.2 Finding The Kemel Source Code 1.18.3 Building the Kernel. 1.19 Patching the Kernel 1.19.1 Downloading and Applying Patches 1.20 TCPAP for System Administrators... 1.20.1 The Layers.. 1.20.1.1 Packets 1.20.1.2 TCP/IP Model and the OSI Model... 1.202 Headers. 1.20.2.1 Ethernet. 2 IP (IPv4).... 1.20.23 TCP.. 1.20.24 UDP. 1.21 A Complete TCP Connection... 12 L211 Opening a Connection nnn 1.21.2 Transferring Data... 1.21.3 Closing the Connection... 1.22 How Arp Works wneen 1.22.1 The ARP Header: ARP Works with Other Protocols, Too! 1.23 Bringing Ip Networks Together 1.23.1 Hosts and Networks... 1.23.2 Subnetting... 1.233 Netmasks... 1.23.4 Static Routing 1.23.4.1 Routing Tables... 1.23.42 Limitations of Static Routing 1.235 Dynamic Routing with RIP... 124 PVG 124.1 IPv6 Address Format.. 1.242 IPV6 Address Types..nem WeLinux Server Admin. (MU B.Sc. COMP -Sem-V)_5 Table of Contents 1.24.3 IPV6 Backward Compatibility 1-49 v Syllabus Topic : Network Configuration and Firewalls. 149 1.25 Network Configuration and Firewalls 149, 1.25.1 Modules and Network in Terfaces 1,25.1.1 Network Device Configuration Utilities (ip and ifconfig)....... 1.25.1.2 IP Aliasing. 1.25.1.3 Setting up NICs at Boot Time... 1.26 Managing Routes..... 1.26.1 Simple Usage.. 1.26.2 Displaying Routes 1.27 How Linux Chooses an IP Address... v Syllabus Topic : Linux Firewalls... Linux Firewalls. How Netfilter Works... A Nat Primer. NAT-Friendly Protocols. Chains Installing Netfiler ... Enabling Netfilter in the Kernel Required Kernel Options. Configuring Netfilter... Saving Your Netfilter Configuration. The iptables Command. Syllabus Topic : System and Network Security. 1-59 System and network security. 1-59 Common Sources of Risk.. oa 1-59 Picking the Right Runlevel to Boot in to .. - 1-60 Limited Resource: 1-60 Mitiga Ting Risk 1-60 161 Monitoring Your System. Table of Contents W tnx Server Admin (MU B.Sc. COMP - Sem-V)_& a eee 1-61 1.31.6 TCPAP and Network Security 1317 Tracking Services... ane 162 1318 Shutung Down Services: 1-62 131.9 Monitoring Your System.. 131.10 Handi = ~ 2 — + 1-63 131.11 Network Security Tools. eee [est 1 ¥ Syllabus Topic : Domain Name System... 2.1 Domain Name System 21.1 The Hosts File.. 22 How DNS Works. 22.1 Domain and Host Naming Conventions...n 2.2.2 Sub-domains.... 22.3 The in-addrarpa Domain .. 2.24 Types of Servers. ) 23° Installing a DNS Server... 23.1 Understanding the BIND Configuration File 23.2 The Specifics 24 Configuring A DNS Server... 24.1 Defining a Primary Zone in the named.conf File. 24.2 Defining a Secondary Zone in the named.conf File 24.3. Defining a Caching Zone in the named.conf File... 25 DNS Records Types... 26 The DNS Toolbox..... me Syllabus Topic : File Transfer Protocol (FTP)... 27 The Mechanics of FTP... 27.1 Client/Server Interactions... 28 Obtaining and Installing vsfipd... Table of Contents Inux Server Admin. (MU B.Sc. COMP - 8.1 Configuring vsfipd ... seetnsentnnannnenenneceman seen Del 8.2 Starting and Testing the FTP Serve 2-15 9 Customizing the FTP Server... 2-16 9.1 Setting up an Anonymous-Only FTP Server... 2-16 9.2 Setting up an FTP Server with Virtual Users... a 216 Syllabus To, -10 Apache Web Server.enenn Apache Web Server... 10.1 The HTTP Protocol... 2.10.2 Installing the Apache HTTP Server... 2.10.3 Apache Modules. 2.10.4 Starting up and Shutting Down Apache 2.10.4.1 Starting Apache at Boot Time 2.10.5 Testing Your Installation, 2.10.6 Configuring Apache 2.10.6.1 Creating a Simple Root-Level Page... 2.1.6.2. Apache Configuration File 2.10.6.3 Common Configuration Option v Syllabus Topic : Simple Mail Transfer Protocol (SMTP). 2.11 Understanding SMTP... 2.11.1 Rudimentary SMTP Detail: 2.11.2. Security Implications. 2.12 Installing the Postfix Server... 2.12.1 Installing Postfix via RPM in Fedora... 2.12.2 Installing Postfix via APT in Ubuntu. 2-28 2.13 Configuring the Postfix Server. : 2-28 2.13.1 The main.cf File.. 2-28 2.13.2 Checking Your Configuration...... = 230 2.14 Running the Server a 2-30 231 v Syllabus Topic : Post Office Protocol and Internet Mail Access Protocol ... 2.15 Post Office Protocol and Internet Mail Access Protocol SEE SO 5 Oe Table of Contents W inux server Adm COMP - Sem-V) (MU 2.15.1 Pop and IMAP Basics. 2.15.2 Installing The UW-IMAP And Pop3 Server... 2.153 Running UW-IMAP...... 2.15.3.1 Checking Basic POP3 Functionality 2.15.3.2 Checking Basic IMAP Functionality ... 2.154 Other Issues with Mail Services... 2.13.4.2 Testing IMAP Connectivity with SSL 2.18.43 Availability. 4.4 Log Files... - Syllabus Topic : Secure Shell... 2.16 The Secure Shell Key Cryptography 2.16.1 Understanding Publis 2.16.1.1 Key Characteristics... 2.16.2. Understanding SSH Versions and Distributions 2.16.2.1 OpenSSH and OpenBSD... 2.16.2.2. Alternative Vendors for SSH Clients 2.16.23 Installing OpenSSH via RPM in Fedora 2.16.24 Installing OpenSSH via APT in Ubunta .... 2.16.3 Downloading, Compiling, and Installing openSSH From Source ... 2.164 Server Startup and Shutdown .....reresee 2.16.5 SSHD Configuration File .. 2.16.6 Using Openssh. 2-41 2.16.6.1 Secure Shell (SSH) 2-41 2-41 2.16.7 Creating A Secure Tunnel. 2.16,7.1 Secure Copy (SCP). 2.16.7.2 Secure FTP (SFTP) 2.16.7.3 Files Used by the OpenSSH Client ¥ Syllabus Topic : Network Authentication... 217 Network Authentication .. W Linux Server Admin. (MU B.Se. COMP - Sem-V)_9 Table of Contents ~ Syllabus Topic : Open LDAP Serve! 2.17.1 OpenLDAP Server v Syllabus Topic : Sarnba and LDAP «..sssssssvesesnien snoennaen o ery 2.17.2. SAMBA and LDAP... 244 v Syllabus Topic : Network Authentication System (Kerberos) 2.18 Network Authentications System (Kerberos). v Syllabus Topic : Domain Name Service (DNS)... 2.19 Domain Name Service. v Syllabus Topic : Security 2.20 Security > Chapter 3: Intranet Services 341 to 8-58 3.1 Introduction... v Syllabus Topic : Network file System (NFS) .. 32 Network File System (NFS)... Mechanism of NFS... Versions of NFS . 3.2.3. Security Considerations of NFS sonst 3.24 Advantages of NFS Disadvantages of NF 3.2.6 Mount and Access a Partition, 3.2.7 Components of NFS. 3.2.8 Configuring an NFS Server. 3.2.8.1 The /ete/exports Configuration File ...., 3.2.8.2. Telling the NFS Server Process about /etc/exports.. 3.2.8.3 The showmount Command 3.2.9 Configuring NFS Clients.. 3.2.9.1 The mount command. 3.2.10 Common Uses For NFS EE, OS | Wey WW Linux server Admin. (wu (OMP -Sem-V) 10 we Syllabus Topic : SAMBA .... 33° SAMBA. 3.3.1 Installing Samba... 3.3.2 Starting and Stopping Samba... 3.3.3 Creatinga share... 3.3.4 Using smbclien 33.5 Browsing a server. 3.3.6 Remote File Access.. 3.3.7 Mounting Remote Samba Shares... 33.8 Creating Samba use... 3.3.9 Troubleshooting Samba... - Y Syllabus Tople : Distributed File System (DFS) 3.4 Distributed File System (DFS).. 3.4.1 DES Implementation 34,2. Terms used in DFS... 34.3 GlusterFS... 34.3.1 Managing Glusterfs 34.3.2 Create a Trusted Storage Pool... 3.4.3.3. Create a Distributed Replicated Volume. 3.434 Mount the glusterfs Volume from the Client (ClientC)... 3.4.3.5 Access the glusterfs Volume from the Client... Y Syllabus Topic : Network Information System (NIS) . 3.5 Network Information System 3.5.1 NIS Servers. 3.5.2. Configuring the Master NIS Server. 3.5.3 Configuring an NIS Client . 3.5.4 — Configuring a Secondary NIS Server. 355 NIS Tools. Y Syllabus Topic : Lightweight Directory Access Protocol (LDAP) .. 36 Lightweight Directory Access Protocol (LDAP)... 3.6.1 3.6.2 3.6.2.1 3.6.2.2 3.6.3 3.6.4 3.6.4.1 3.6.5 3.6.6 37 371 3.7.2 38. 3.8.1 3.8.2 3.8.3 3.84 3.8.5 39 3.9.1 3.10 3.10.1 3.10.11 3.10.1.2 3.10.1.3, 3.10.1.4 1 Table of Contents LDAP Terminology. OpenLDAP Server-Side Daemons..... OpenLDAP Utilities... Installing OpenLDAP. Configuring OpenLDAP Configuring stapd Configuring Opentdap Clients... Creating Directory Entries.. Syllabus Topic : Dynamic Hast Configuration Protocol Dynamic Host Configuration Protocol... Setting up DHCP Server... Configuring the DHCP Client... Syllabus Topic : MySql. MySql... Installing and Starting MySQL..... Verifying MySQL Installation Post-installation Steps Running and Shutting down MySQL Server. Setting Up a MySQL User Account. Syllabus Topic : LAMP Applications... LAMP Applications LAMP Installation... Mabus Topic : File Servers .. File Servers.. FTP Server ios vsftpd - FTP Server Installation Anonymous FTP Configuration... User Authenticated FTP Configuration. Securing FTP pee Table of Contents Linux Server Admin. (MU B.Sc. COMP - Sem-V)_12 at 3-48 3-49 3.10.2 NFS... v Syllabus Topic : E-mail Services BAL E-mail Services... BALL Postfix... 3.MLAA Configuring Postfix... 3.11.2 Dovecot Server. 3.11.3 Mail Filtering. ¥ Syllabus Topic : Chat Applications . 3.12. Chat Applications. 3.121 IRC Server. 3.122 Jabber Instant Messaging Server. ¥ Syllabus Topic : Virtual Private Network... 313 Virtual Private Network 313.1 OpenVPN 3.13.11 Public Key Infrastructure Setup + Lab Manual © Appendix A : Solved Univer + University Question Paper ity Question Paper of Oct. 2018 COMP - Sem-V) _13 Table of Contents ‘Statement Name of the Program Page Nos. La Installing DHCP server in Ubuntu 16.04 Lt to L-9 L2 Initial Settings. Add a user, Network Settings, Change to static IP address, Disable IPv6 if not needed, Configure Services, display the list of services which are running, Stop and turn OFF auto-start setting for a service it you don't need it, Sudo Settings. L-10 to L-12 L3 Configure NTP Server (NTPd), Install and Configure NTPd, Configure NTP Client (Ubuntu and Windows) Network Time Protocol (NTP) has unique ability for companies to synchronize the clocks of all the systems within the company. L139 to L-14 La SSH Server: Password Authentication, Configure SSH Server to manage a server from the remote computer, SSH Client (Ubuntu and Windows) Password Authentication for Open SSH Server on Ubuntu is enabled by datault, so it's possible to login without changing any settings. L15toL15 Ls Install DNS Server BIND, Configure DNS server which resolves domain name or IP address, Install BIND 9, Configure BIND, Limit ranges allow to access if needed. Le Configure DHCP Server, Configure DHCP (Dynamic Host Configuration Protocol) Server, Configure NFS Server to share directories on your Network, Configure NFS Client (Ubuntu and Windows Client OS) L-16toL-16 Linux 14 Table of Contents ‘Steterment Name of the Program Page Nos, u7 Configure LDAP server, Configure LDAP Server in order to share users accounts in your local networks, Add LDAP User | L-19 to L-22 Accounts in the OpenLDAP Server, Configure LDAP Client in order to share users accounts in your local networks. Install phpLDAP admin to operate LDAP server via Wo browser Ls Configure NIS Server in order to share users’ accounts in | L-22 to L-23 your local networks, Configure NIS Client to bind NIS Server. Lo Install MySQL to configure database server, Install phpMyAdmin to operate MySQL on web browser from | 1.23 to L-25 clients. L10 Install Samba to share folders or files between Windows and L-25 to L-26 goog CHAPTER Introduction to Linux Syllabus Introduction : Technical Summary of Linux Distributions, Managing Software Single-Host Administration : Managing Users and Groups, Booting and shutting down processes, File Systems, Core System Services, Process of configuring, compiling, Linux Kernel Networking and Security : TCP/IP for System Administrators, basic network Configuration, Linux Firewall (Netfilter), System and network security Syllabus Topic : Technical Summary of Linux Distributions 11 Technical Summary of Linux Distributions In this chapter, we will see some core server-side technologies that are implemented in the Linux world and in the Microsoft Windows Server world. 1.1.1. Linux: The Operating System Q. 1.1.1 Explain Linux Operating System in detail. 7 - — Linux kernel is the heart of the operating system which acts as chief of operations. It can start and stop other programs, handle requests for memory, access disks, and manage network connections. The kernel is a significant program. - Linux distributions are divided into two groups i.e. commercial distribution and non-commercial distribution. © The commercial distribution supports their distribution at a cost. Examples are RHEL, SuSE Linux Enterprise etc. Introduction 6 Liny q We Linux Server Admin. (MU B.Sc. COMP Sem-V) _1-2 © The noncommercial distribution is free which is mostly community supported ayg maintained. Examples are Fedora, OpenSuSE, Ubuntu, Debian, ele. 1.1.2 Open Source Software and GNU 1980s, Richard Stallman in software industry stated that software should be free i.e, not jp terms of price but as freedom. The fact behind giving source code is that, User should not be forced to deal with a developer who might or might Not suppoy, ° that user's aim for the software, © Code developed under observation of different programmers is of high quality thay hiding the code from others co They can add new features to program and contribute so that others can use it, 1.1.3. GPL: General Public License It states that the software being released is free and no one can change it. We can take the software, resale it with the full source code with certain changes for the profit. The resold material remains under the license so we can resale it for the profit. Only GPL, is not used by open source software developers, BSD and Apache is also used. 1.1.4 Advantages and Disadvantages of Open Source Software Q. 1.1.2 _Whatare the advantages and disadvantages of Open Source Software? - Open source software projects are successful for two reasons: © As the code is open to peers, errors are handled properly and fixed. © — Programmers release the code without any fear of being taken any legal action. © Itis independent on the author who has originally created it. ~ With some advantages there comes some disadvantages also, © As open source software is free, there may be some unintended cost involved. © AS itis open to all malicious users can view and exploit any vulnerability. © If you are unable to download open source software, you have to get into the forum and asked for possible options to handle the thing. No personalized support. 115 Understanding the Differences between Windows and Linux 9.1.1.3 Explain the difference between Windows and Linux. ~ J Linux users can access the source code whereas users of Windows can’t do it. EE. CEE UE W7_Linux Server Admin, (MU B.Sc, COMP - Sem-V) _1-3. Introduction to Linux = With the GPL license you can install Linux on many machines, and you can also modify the software and publish again as it is free. In Windows you can only install on that many number of machines which you have paid for. — InLinux if any problem occurs you have to get involved in the forum for any suggestions, rather in Windows you will get a personalized support. = In Linux command line is there though as many desktop environments have been introduced, In Windows also command line is used but not close to as Linux. — Linux is flexible i.e. you can do anything. Windows is rigid i.e. what Microsoft will give you, you have only that much- means you are stuck into Microsoft. - Linux is modifiable whereas Windows is not. Syllabus Topic : Managing Software 1.2 Managing Software Q. 1.2.1 _ Write a short note on Managing Software. — There are many ways a system administrator handles software and application management. System administrators install the latest version available which has its advantages and disadvantages, — There are different approaches to install software on a Linux system. 1.2.1. The RPM Package Manager Q.1,2.2 Explain RPM Package Manager in detail. ] - RPM was written in 1997 by Erik Troan and Mare Ewing. In RPM i.e. Red Hat Package Manager you can easily install and remove software packages that consist logs of files and other metadata. Red Hat Package Manager (RPM) file is a package that consists files like configuration files, binaries, and even pre- and postscript which are needed for the software to function correctly. - Various Linux Distribution use this type tool for distributing and packaging their software. Red Hat Package Manager tool performs installation and uninstallation of RPMs.RPM packages are installed from, http://ippm.pbone.net etc. Fedora, OpenSuSE, comes with RPM. = Functlons of RPM — To install and uninstall software W Linux server Admin (MU B.Sc. COMP. em) 1-4 Introduction 1 Linux ~ To maintain a database which stores various items of information about the packages - To package other software into an RPM form — To update programs with original RPM installed are easy. 1.2.2. The Deblan Package Management System @.1.2.3 Explain Debian Package Manager in detail. — Debian Package Management System is used for managing software Debian-like systems These packages have .deb extensions. = There are two types of Debian packages i.e. Binary Packages and Source Packages. These or parts of packages. tools are used to manipulate and manage packag. — Debian package consist of executable files, libraries, and documentation associated with set of related programs. Packages in Debian are called “deb” files. dpkg ie. Debian Package can directly operate .deb files. 1.2.2.1 APT \ = APT is an advanced toolset which interacts directly with debian package. APT indirectly deals with deb packages which manage software through the locations specified in a configuration file - APT utilities use the sources list file to detect repositories of the package distribution system — The cached list of packages and the dependencies that must be installed or updated are searched by APT. 1.2.3 Managing Software Using RPM [.@-1.2.4 Explain the steps to manage software using RPM. Querying. installing, uninstalling, and verifying software on Red Hat-based systems is discussed below 1.2.3.1 Querying for Information the RPM Way - After you get the software from internet or any other third party, you need to know all about the software before using it. - To see the packages currently installed on the system use rpm command. froot@fedora ~}# rpm-—query -all Se ee W Linux Server Admin, (MU B.Sc. COMP - Sem-V)_1-5. Introduction to Linux 1.2.3.2 Installing with RPM (Moving In Together) ‘You will install the application called ‘lynx’, then a copy of the rpm package is needed which we can get from CD/DVD, Internet. Stepwise process of Installing an RPM 1, Launch a virtual terminal. Assume that your distribution install media disc is mounted at the /media/dvd mount point, change directory to that usually contains the RPM packages on the DVD. Type [root @ fedora ~]# ed /media/dvd/Packages/ 3. Use the Is command to list all files that start with the letters “lyn” in the directory. Type [root @ fedora Packages) # lelyn* Iynx-2.".xpm 4. Perform a test install of the package if you are confirmed about the file if it is there. Type {root @ fedora Packages}# rpm ~install --verbose —hash —-test lynx-* Preparing... S##EHEHHHAHHAERAEEHEHEEREABHE REED ERERE (100%) 5. Type [root @ fedora Packages}# rpm -ivh lynx-* Preparing.. #EEHEAEEHEREREEAREDEEEERERHEHE ELE EFF [100%] Lilyns BEAEAEEA EAA RE EEE ARE DAAPERRE [100%] 6. To check if application is installed on the system. Type [root @ fedora Packages}# rpm -q lyn lynx-2.* 1.2.3.3. Uninstalling Software with RPM (Ending the Relationship) — To remove software in RPM is easy task, you just have to use -€ option. [root @ fedora~ ]# rpm -e lynx 1.2.4 Software Management In Ubuntu [9.1.2.5 Explain the steps of Software management in Ubuntu aoe: =] Software management in the Debian-like distribuuon such as Ubuntu is done using DPMS as follows : & Querying for Information - On Ubuntu server, the following command is used to list all currently installed software root@ubuntu-server:~$ dpkg -1 1. Fedora To start the GUI package management tool in Fedora select, System menu —+ Administration + Add/Remove Software. > 2. OpenSuSE and SLE System administration is done via tool called YaST, i.e. Yet Another Setup Tool which is made of various modules. To add and remove packages graphically on system sw_single is used | Introduction to Linux } W_Linux Server Admin. (MU B.Sc. COMP -Sem-V)_1-7 > 3. Ubuntu Various GUI software management tools are available on Ubuntu systems. GUI tools are installed by default for desktop class Systems. 1.2.6 | Compile and Install GNU Software Q. 1.2.7 _ Explain the steps of how to compile and install GNU software. — Having open source software is advantages, as you get acces* (9 the source code, you also can fix the problem if you get it. — Following shows the stepwise process of compiling the hello package. Compile and Install Gnu Software 1. Getting and Unpacking the Package } 2. Looking for Documentation 3. Configuring the Package 4. Compiling the Package 5. Installing the Package } 6, Testing the Software 7. Cleanup | | Fig. 1.2.2 : Compile and install GNU software > 1. Getting and Unpacking the Package The tools used to combine files and compress are tar and gzip. To install Hello following are the steps. 1, Download the Hello program (hello-2.3.tar.gz), from www.gnu.org/software/hello and save the file to the /usr/local/sre/ directory. 2. Once downloaded we need to unpack it. [root@fedora-serverA src}# tar -xvzf hello-2.3.tar-gz hello-2.3/ hello-2.3/build-aux/ hello-2.3/build-aux/config.guess hello-2,3/build-aux/eonfigarpath COMP -Sem-V) 1.8 Introduction to ux. hello-2.3/build-aus/eonfig.sub << OUTPUT TRUNCATED>.... hello-2.3/build-aux/depoomp The z parameter calls gzip to decompress the file before the untar process occurs. The y parameter tells tar to show the name of the file itis untarring. 3. Change to the new directory hello-2.3 and list the contents. froot@fedora-serverA src] # cd hello-2.3 : Is > 2. Looking for Documentation You should always read the documentation that comes along with source code. That files are README and INSTALL. The README file contains description of the package, references to additional documentation, and references to the author of the package. The INSTALL file has directions for compiling and installing the package. > 3. Configuring the Package ‘An auto-configuration script named configure (or config), accepts parameters. Each package has some features which can be enabled and disabled and also set some special values. The default options available through configure script are, [root @ fedora-serverA hello-2.3]# Jfeonfigure checking for a BSD-compatible install... fuse/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for gee... gee «OUTPUT TRUNCATED>.... config, status: creating po/Makefile If configure fails, you will not get a makefile which is foundation of compilation phase. > 4. Compiling the Package The make tool reads all of the makefiles created by the configure script which files to compile and the order in which to compile them: [reot@fedora-serverA hello-2.3]# make If there is no problem in compilation there are not any error messages. ——— cr WLinux Server Admin. (MU B.Sc. COMP = Sem-V)__1-9 Introduction to Linux eee Aan (MU BSc. COMP = SON) > 5. Installing the Package When package gets compiled successfully, following command is used to run and install the package at specified location. [root @fedora-serverA hello-2.3]# make install 6. Testing the Software v After configuring, compiling and installing, user does mistake of not testing the software. Testing should be done to check whether it runs or not. + 7. Cleanup Cleanup is done to get rid of all the temporary files created during the installation. Syllabus Toplc : Managing Users and Groups 1.3 Managing Users and Groups User accounts are used for determining who has access to what data and has proper permissions. In multiuser system, a system administrator should understand what constitutes a user, a group, and how they interact together. 1.3.1 Definition of User Q.1.3.1 Explain User. 1 — A user owns the file and program in Linux. Each user constitutes a unique identifier called a user ID (UID). — Each user belongs to at least one group, also to multiple groups. Groups also have unique identifiers group ID (GIDs). 7 Each user's rights are explain In two ways - Normal user is those who have accéss to only those files which are own or have permission. — Root user has access to all the files and program in system which is also called superuser. 1.3.1.1 The /etc/passwd File Q.1.3.2 Explain etc/passwd file. 3) — The user's login, encrypted password entry, UID, default GID, name home directory, and login shell are in /ete/passwd file. The fields are as follows: a — Username: Also called as login field or the account field which stores the name of the user on the system where as a common method to generate user login name is to use the first letter of the user's first name and append the user’s last name. — Password: It contains the encrypted password for the user which is compared against the user's password entry when login is done. User-ID: It is a unique number to identify the user and determine access privileges. User with UID 0 has root access. Group -ID: It is number of the primary group that the user belongs to which determines user access privileges. GECOS: It stands for General Electric Comprehensive Operating System. It is an optional field which stores different pieces of information like user description, full name, telephone number etc. Directory: It’s a home directory where users are allowed to keep configuration and regular files. - Shell: It provides an interface between user and system. The default user shell is BASH. 1.3.1.2. The /ete/shadow File [0.1.3.3 Explain /etc/shadow file in detail. It stores encrypted password information. /ete/shadow file is readable only to root users or any privileged programs whereas etc/password file is readable to all the users. The fields of ‘etc/shadow file are, - Login name - Encrypted password ~ Days since January 1, 1970, that password was last changed — Days before password may be changed - Days after which password must be changed ~ Days before password is to expire that user is warned — Days after password expires that account is disabled — Days since January 1, 1970, that account is disabled — Areserved field The /etc/group File Explain /etc/group file in detail. _—— EEE ee EE eee a W Linux Server Admin, (MU B. jem-V)_1-11 Introduction to Linux OMP This file consists of a list of groups. Each user belongs to one group, additional groups may be added if necessary. The fields in /etc/group are. 1.4 Group name: The name of the group Group password : This is optional, if set, it allows users who are not part of the group to join. Group ID (GID) : The number of the group name. Group members : It is a comma-separated list User Management Tools Q.1.4.1__ Explain the various user management tools. Q.1.4.2 Explain the following terms useradd, usermod, userdel, groupadd, groupdel, groupmod. Following are some user management tools which are used from command line interface and graphical user interface. 1.4.41 User Management tools 1. Command line Interface (V) useradd {ii) usermod (ii) userdel (lv) groupadd (¥) groupde! ] (w) groupmed 2. GUI User Managers Fig. 1.4.1: User management tools Command line Interface Command-line tools are incorporated into other automated functions which is an advantage. Following are some command-line Interfaces, WW Unuxserver Admin (MU B Se, COMP - Sem V) 1-12 Introduction to Linu. 1.4.1.1 useradd ~ _useradd adds a single user to the system and sets default information for new users. Syntax useradd-D [options] Option Description -c comment — | Short description of login, can be text string -dhomedir | the user's home directory is /home/user_name by default -e expire date | The date on which the user account will be disabled. -g initial group | the default group the user has in the password file is specified -G group Specifies the additional group to which new user belongs -bhelp Displays a help message and exit 1.4.1.2 usermod It modifies an existing user and its setting in the system Syntax usermod [options] Option Description “a Add a user to the group “ New value of password file to comment field -I new login | User name changes a Locks users password -m Move content of users home directory to new location 1.4.1.3. Userdel It removes the existing user. Syntax userdel(-r] username — eee Linux Server Admin. (MU B.Sc, COMP - Sem-V)_1-13. Introduction to Linux 1.4.1.4 Groupadd This command works same as user commands instead they work on groups listed in Jetc/eroup file. This adds groups to /ete/group file. syntax groupadd [options] group Option Description -f | Exit with success status if the specified group already exists. -h__ | Displays help message and exit -g | The unique value of Group ID -o | Adds a group with non-unique GID +t | Creates a system group 1.4.1.5 Groupdel This removes existing groups in /etc/group file. Syntax groupdel group 1.4.1.6 Groupmod This command modifies the parameters of existing group. Syntax groupmod [options] group Option Description “2 Changes GID of the group -n Specifies a new name for the group 1.4.2. GUI User Managers One of the most obvious advantages of GUI managers is ease of using it Linux distributions have its own GUI managers, i.e. Fedora uses system-config-users, RHEL uses redhat-config-users and Ubuntu uses users-admin. In Ubuntu, user management tool is Taunched as, kbp@ubuntu-server:~$ sudo users-admin 4 Introduction to Linux W unux server Admin. (MU OMP - Sem-V) 15 Users and Access Permissions [0.1.5.1 Explain users and their access permissions in deta, Linux regulates whether a user has permission or not. Four access type are, 6 Read permission(r) © Write permission(w) © Execute permission(x) © No permission or no access(-) Three classes of users are, © Owner: The owner of the file or application © Group: The group that owns the file or application co Everyone: ll users 1.6 Pluggable Authentication Modules (PAM) ‘\ [316-1 Wie a shor nate on PAM PAM uses centralized authentication mechanism in system. It allows programs that depend on authentication to be written independently of the underlying authentication scheme. Without creating their own authentication schemes PAM issues a single, fully- documented library which allows developers to write programs. PAM makes excellent use of the system log files, you can use that information to change your settings and fix your problem. 1.6.1 Working of PAM A function which exist in PAM library is called when programs needs to perform authentication on someone. PAM checks the configuration file for the application, when it is called, A default configuration file is used when configuration file is not found which tells what type of checks is needed to authenticate user. Further a module is called on which checks the /etc/passwd file or the /etc/shadow file, or it can perform a more complex check, like calling on an LDAP server. An “authenticated/not authenticated” message is passed to the calling application when the module has made resolution. em-V)_ 1-15. Introduction to Linux coMi Linux Server Admin. (MU Syllabus Tople : Booting, Shutting Down and File Systems 1.7 Booting, Shutting Down and File Systems Nowadays operating systems are more complex so the starting and shutting process has become more detailed. 1.7.1 Boot Loaders Q.1.7.1 Explain in detail about Boot Loaders: Q. 1.7.2 _List the different types of boot loaders and explain. - For boot process of any operating system you need boot loader. It is the first software program which runs firstly when your computer starts which takes control of the system. - On disk Master Boot Record (MBR) is the place where boot loader occupies its space. ‘There are two boot loaders in Linux, namely GRUB (Grand Unified Bootloader) and LILO (Linux Loader). 1.7.1.1 GRUB Q.1.7.3 Write a short note on Grand Unified Bootloader — Most Linux distributions such as Fedora, Red Hat Enterprise Linux (RHEL), OpenSUSE, Mandrake and Ubuntu they use GRUB as the default boot loader. ~ GRUB boot process takes place in stages which are important. In GRUB device names are shown in parenthesis “()”. Stage1 An image file which is named as Stage | used for booting up GRUB in the first place which is important. It is implanted in the MBR of a disk or in the boot sector of a partition. © Stage 2 This stage has two types of Stages i.e. optional (which is called as Stage 1.5) and actual stage 2 image file. Stage 1.5 acts as a bridge between Stage 1 and Stage 2 and also allows GRUB to access various file systems. Stage 2. is the core of the GRUB which contains the actual code to load the kernel that boots the OS. It also contains the GRUB shell which is interactive and flexible from which GRUB commands can be entered.

You might also like