YUM Server Configuration Steps: VI /etc/fstab
YUM Server Configuration Steps: VI /etc/fstab
YUM Server Configuration Steps: VI /etc/fstab
LAB: - ---------------------------------------------------------------------------------------------
~] # cd /popo/
Popo] # cd Server
Server] # rpm –ivh vsftpd (press tab key to complete the command)
Server] # rpm –ivh createrepo (press tab key to complete the command)
Server] # cd /var/ftp/pub
Server] # cd Server
Server] # createrepo –v /var/ftp/pub/Server/
*Note:- if you want to install software on server then use the following command. Open the file. And
edit the file
~] # vi /etc/yum.repos.d/server.repo
[server]
Name=test
Baseurl=file:///var/ftp/pub/Server
Gpgcheck=0
Enabled=1
:wq
yum grouplist
To install CLI -
vi /etc/yum.repos.d/server.repo
[Server]
name=test
baseurl=ftp://192.168.0.254/pub/Server
gpgcheck=0
enabled=1
________________________________________________________________________________
Yum localinstall rpmfilename - Install the local rpm filename and it will search local repository
for dependencies
Yum groupinstall gnome-desktop - Install all packages that are part of the group named gnome-
desktop. It will search local repository for dependencies
Yum remove packagename - remove the package, if any package is depends on my package
then it will prompt to remove the package
Yum update mypackage -updates the older version with newer version.
Configuration are over written and old configuration files are saved with either .rpmsave or .rpmnew.
_____________________________________________________________________________________
Yum Queries
Yum search searchterm - it will search for all packages having the searchterm in package
names, description and packager
Yum list ‘*irefo*’ - It will search the packages with *irefo*, Quotes are must
Yum list installed ‘*irefo*’ - search in installed packages only
Yum info ‘*irefo*’ -display information after searching pkg ( installed & repo)
Configuring repository
[reponame]
Name=description
Baseurl=file:///mnt
Enabled=1
Gpgcheck=0
_____________________________________________________________________________________
Name-version-release.architecture.rpm
Rpm –F – freshen ( if older version does not exist it will skip installation)
Rpm –U – upgrade ( if package does not exist then it will treat it as fresh installation
Rpm Query
RPM Verification:- verifying an installed package compares the file sizes, permission, type, owner,
group, MD5 checksum, and modify time against the RPM database. Any inconsistency will be reported.
An installed package can also be verified against a package file as well:
Syntax: - rpm -V zip verifies the installed zip rpm against the RPM database.
rpm -Va verifies all installed RPMS against the RPM database.
rpm -Vp zip-2.3-8.i386.rpm verifies the installed zip package against the zip
pacakage file.
Chapter -2
Run Levels
Run Levels are different modes to run linux with different configuration. Init defines 0 to 6 run
levels
Defines in file [ /etc/inittab ]
Following chard details the run levels that linux defines by default:
Runlevel Effect
0 Halt
1,s,emergency Single user modes ( Only root user can be
logged on. Used to perform Maintenance )
2 Multi-user, without NFS networking
3 Full multi-user mode. ( Includes networking )
4 User definable, but duplicate of run level 3
5 X11 ( Includes networking )
6 Reboot
Note :- If there is no run level defined then system will attempt to boot to run level 9 which is
undefined.
Daemon Process
A daemon process is a program that is run in the background, providing some system service
Two types of daemons
Standalone ( Controlled by init or by a startup script /etc/rc.d )
Transient : ( Controlled by the “ Super-daemon xinetd )
Password Protecting – Single user mode
su:S:wait:/sbin/sulogin
XINETD Services
/etc/xinetd.conf, /etc/xinetd.d/service
Controlling service
Chkconfig --list
Chkconfig nfs on
UNIT-3
Kernel Services
Kernel documentation is provided with the kernel source code and is distributed by Red Hat in the
kernel-doc RPM. The documentation can be found under /usr/share/doc/kernel-doc-* /documentation
Modprobe usb_stroage
Modprobe –r usb_storage
To Mount the root file system Kernel needs modules such as ext3,raid1,scsi_mod etc
An initial RAM DISK provides modules ( /boot/initrd-$(uname -r).img } ( CPIO Image of the modules)
Readonly files
/proc/cpuinfo
/proc/1/*
/proc/partitions
/proc/meminfo
Read-write Entries
/proc/sys/kernel/hostname
/proc/sys/met/ip4/ip_forward
/proc/sys/vm/drop_cache
/proc/sys/vm/swappiness
Sysctl
Processes – ps , top,gnome-system-monitor
Hosta> ssh-keygen –d
/etc/cups/cupsd.conf
cupsd server configuration file
/etc/cups/printers.conf
Print queue configuration file
Printing Commands
system-config-printer : Utility to install and manage print devices
lpr : command to send print jobs to print device
lpq : command to view print queues
lprm : command to remove print jobs
lpadmin : command line tool for printer administration
Using Scheduling [ cron ]
Used to schedule recurring events
Use crontab to edit, install and view job schedules
Command Examples
Crontab OPTIONS
-l list crontab
-r removes crontab
-e edits crontab
Using Crontab File
• Fields in a crontab file can be separated by any number of tabs or spaces
Controlling Cron
Restrict / allow user access to cron
/etc/cron.allow
/etc/cron.deny
Contains usernames to allow / deny access
System Logging
What is System Logging ?
An important part of maintaining a secure system is keeping track of the activities that take
place on the system. If you know what usually happens, such as understanding when users log
into your system, you can use log files to spot unusual activity
Two main logging daemons
klogd :The kernel log daemon service logs kernel messages
and events
syslogd :The syslog daemon logs all other process activity. You can use the log
files that syslogd generates to track activities on your system
Log Files
/var/log/dmesg : Kernel log messages
/var/log/messages : Standard system error messages
/var/log/maillog : Mail System messages
/var/log/secure : Security, authentication, and xinetd messages
utmpdump /var/log/wtmp
Test – On client
logger -i -t username “this is to be sent to remote server”
tmpwatch- deletes all files in /tmp which have not been accessed for 240hours ( 10days)
Anacron
Runs cron jobs that did not complete when computer was down ( /etc/anacrontab)
UNIT-5
Understanding Filesystem Management
Partition Type
5 or F Extended
82 Linux Swap
83 Linux
8e Linux LVM
Fd Linux Raid
Blkid can be used to see labels and filesystem type of all devices
Tune2fs /dumpe2fs
/etc/fstab entries
Dumpfrequencey –
0 never
1 daily
2 every other day etc
Mount options
Rw read write
NFS Server
/etc/exports *(rw)
/etc/exports 192.168.1.0/24(rw)
/etc/exports 192.168.1.1(options)
Automounter
/etc/auto.master
/etc/auto.home
‘* -fstype=nfs server:/export/home/&
CH-6
User administration
Options
Groupadd groupname
Chmod u+s filename – Setuid 4 ( s in rws) ( S in rwS – if execute bit is also set)
4 – read
2 write
1 execute
Make
Usage
[Temporary]
Mount -t ntfs-3g /dev/sda1 /mnt/windows