0% found this document useful (0 votes)
16 views44 pages

Linux - Part 2a

The document provides an overview of service management in Linux, detailing commands for managing services using 'service', 'chkconfig', and 'systemctl'. It also covers Linux installation processes, software management using package managers like 'rpm', 'yum', 'dnf', and 'apt', and explains network basics including TCP/IP and Network Address Translation (NAT). Key commands and concepts for managing services, software, and network configurations are highlighted throughout.

Uploaded by

mani.hen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views44 pages

Linux - Part 2a

The document provides an overview of service management in Linux, detailing commands for managing services using 'service', 'chkconfig', and 'systemctl'. It also covers Linux installation processes, software management using package managers like 'rpm', 'yum', 'dnf', and 'apt', and explains network basics including TCP/IP and Network Address Translation (NAT). Key commands and concepts for managing services, software, and network configurations are highlighted throughout.

Uploaded by

mani.hen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 44

Service Management

Service Management Overview


• service – manage a service
• chkconfig – enable/disable service startup on system
boot
• systemctl (only on more recent Linux versions)
• Not always installed by default
service command syntax
• service --status-all
• Returns the status (running/stopped) of all services
• service <service name> status
• service <service name> start
• service <service name> stop
• service <service name> restart
chkconfig command syntax
• chkconfig <service name> on
• Enable the service to start at boot time
• chkconfig <service name> off
• Disable the service from starting at boot time
chkconfig not used on Ubuntu
systemctl command syntax
Use instead of service
• systemctl status <servicename>.service
• systemctl start <servicename>.service
• systemctl stop <servicename>.service
• systemctl restart <servicename>.service
Use instead of chkconfig
• systemctl enable <servicename>.service
• systemctl disable <servicename>.service
Service Names (CentOS)
• httpd (Apache server)
• ntpd (NTP server)
• vsftp (FTP server)
• named (DNS server)
• sshd (SSH server)
/sbin/service
• service is a shell script
• Calls specified script in /etc/init.d

Service Management (4:33)


Installation
Management
Linux Installation Overview
• Choose the Linux Distribution
• Choose and download the image
• Choose the installation method
• Start the installation
Linux Distributions
.
DEB

RPM RPM
Typical Linux OS Installation Steps
• Select the language
• Select the physical disk
• Define the partition settings
• Define the network settings
• Select the time zone
• Select the graphical desktop
• Create the local user and password
• Select the root password
• Install the software
Ubuntu Desktop Download
.

https://www.ubuntu.com/download/desktop
Fedora Server Download
.

https://getfedora.org/en/server/download/
Linux OS Installation Method
• A Linux OS can be installed from
• DVD
• USB Drive or SD card (needs UEFI microcode support)
• Older PCs do not support UEFI
• Network using PXE
Software Installation Overview
• Root user can install software
• Non-root user must have root privileges to install
software using the sudo command
• Software can be installed from
• DVD
• USB Drive or SD Card
• Hard Disk
• Internet software repositories
Managing Software
• Software is provided as .rpm packages on RedHat based
systems (e.g. CentOS, Fedora)
• Software is provided as .deb packages on Debian based
systems (e.g. Debian, Ubuntu, Mint)
• Easy installation and removal
• Software information stored in a local database
rpm
rpm – RPM package manager
• Usage: rpm [options] [package]
• -qa (list all installed rpms)
• -ivh package (install rpm)
• -Uvh package (update rpm)
• -e package (remove rpm)
• -q package (check if installed)

$ rpm –qa | grep <pattern>


yum (CentOS CLI)
Yellowdog Update Modified
• Front-end to rpm
• Designed to resolve package dependencies
• Can locate packages across multiple repositories
• Global settings found in /etc/yum.conf

Installing Software Packages (RPM, YUM and D


NF) (3:26)
yum Syntax
• Usage: yum [options] command
• yum install packagename
• yum remove packagename
• yum update packagename
• yum list [all|available|extras|installed|recent|updates]
• yum info packagename
• yum whatprovides filename
• yum repolist
yum examples
$ yum list installed // show installed rpms
$ yum list available // show available rpms
$ yum list all // show all rpms in repositories
$ yum list available // includes uninstalled
$ yum repolist // show known repositories
$ su // must be root user to install software
# yum install nano // install nano editor
# nano // run nano editor

Linux Software Management with YUM (7:58


)
dnf (CentOS CLI)
Dandified Yum
• Next generation of yum
• Has similar features and syntax to yum
• Global settings found in /etc/dnf/dnf.conf
dnf Syntax
• Usage: dnf [options] command
• dnf install packagename
• dnf remove packagename
• dnf update packagename
• dnf list [all|available|extras|installed|recent|updates]
• dnf info packagename
• dnf provides filename
• dnf repolist
Linux Software Repositories
• Database for what software is available on
the repository server and their dependencies
• Different repositories for different Linux’s
• Search for software on a repository server
• Download software from a repository server
• Can configure the local system to use specific
repositories
• Repository server can be local or remote
Adding a Repository
For YUM
• Create .repo file for the new repository in
directory /etc/yum.repos.d
• .repo file contains
[repo-name]
name=A nice description
baseurl=http://yourserver.com/path/to/repo
enabled=1 // include as a package source
gpgcheck=1 // enable GPG signature-checking
Create a private repository
For YUM,
• Create a directory to hold your packages
• Make this directory available by http/ftp
• Install the createrepo RPM
• Run createrepo -v /package/directory
• Creates repodata subdirectory
• Creates needed support files
dpkg
dpkg – Debian Package Manager
• Usage: dpkg [options] [package]
• -l (list all installed debs)
• -i package (install debs)
• -r package (remove debs)
• Used for .deb packages
$ dpkg –l | grep <pattern>
dpkg Front-end Utilities
Used for .deb packages
• apt-get/apt-cache (older)
• aptitude (newer)
• apt (newest)
apt
Advanced Package Tool
• Front-end to dpkg
• Designed to resolve package dependencies
• Can locate packages across multiple repositories
apt Syntax
• Usage: apt [options] command
• apt install packagename
• apt remove packagename
• apt update packagename
• apt search [‘~i’ | ‘!~i’ ] // show installed, not installed
• apt show packagename // show package info
apt examples
$ apt list ‘~i’ // show installed debs
$ apt list ‘!~i’ // show available debs not
installed
$ apt list ‘~i’ | grep nano // is nano
installed?
$ su // must be root user to install
software
# apt install nano // install nano editor
# nano // run nano editor

Simplify Your Command-Line with APT instead of apt-get (


8:56)
aptitude Syntax
• Usage: aptitude [options] [command]
• aptitude install packagename
• aptitude remove packagename
• aptitude update packagename
• aptitude search packagename
• aptitude show packagename // show package info

Aptitude vs apt-get (5:05)


aptitude TUI
• Run aptitude w/o options or arguments
.
apt-get/apt-cache Syntax
• Usage: apt-get [options] [command]
• apt-get install packagename
• apt-get remove packagename
• apt-get update packagename
• Usage: apt-cache [options] [command]
• aptitude search packagename
• aptitude show packagename // show package info

Linux Advanced Package Tool (apt) and apt-get (5:38)


Network Basics
TCP/IP
Objectives
• IPv4 and IPv6 Addresses
• TCP
• UDP
• Network Configuration
• Network Address Translation (NAT)
• Firewall Management
• Ethernet Device Management
TCP/IP Overview
Transmission Control Protocol/Internet
Protocol
• First defined in 1974 by ARPA
• Allows communication between systems
• Every connected system has an IP address
• IPv4 (32-bit or 4 bytes) (4 billion addresses)
• IPv6 (128-bit or 16 bytes)
IPv4 Address
.
IPv4 Network Classes (A,B,C,D,E)
• nsa.gov (Class A) (1 byte) 104.112.30.179
• ISP (Class B) (2 bytes)
• 172.49.118.76 (example IPv4 address)
• 255.255.0.0 (subnet mask)
• Home Router (Class C) (3 bytes)
• 192.168.1.1 (example IPv4 address)
• 255.255.255.0 (subnet mask)
• Home system (Class D) (4 bytes)
• 192.168.1.90 (example IPv4 address)
• 255.255.255.255 (subnet mask)
• 127.0.0.1 is reserved for the local system
(localhost)
IPv6 Address
.

Internet Protocol - IPv4 vs IPv6 as Fast As Possible (6:11)


Application Stack
.

Application Layer

}
Transport Layer

Physical Layer
NAT
Network Address Translation
Network Address Translation (NAT)
• Public IP addresses are used on the Internet
• Private IP address are used on a local network
• NAT converts public and private IP addresses
• Router performs NAT operations
• Router maintains tables that map public to private IP
addresses
• Router changes source and destination address fields in
IPv4 header as needed
NAT Concepts
.

You might also like