Download presentation
Presentation is loading. Please wait.
1
LINUX ADMINISTRATION 1
2
Unit 2 Chapter-1
3
CHAPTER 1 : RED HAT SYSTEM
Configuration Files system configuration files in the /etc directory The /etc directory is probably the most often visited directory it is important to keep the file permissions set properly on everything in /etc files such as /etc/shadow, where users‘ hashed passwords are stored The /etc/sysconfig directory contains configuration scripts
4
Examining the System Configuration Files.
Systemwide shell configuration scripts These files determine the default environment settings of system shells /etc/bashrc affects bash shells systemwide but /home/siddhu/.bashrc effects only the shells started by user siddhu
5
SHELL CONFIG SCRIPTS: BASHRC, CSH.CSHRC, ZSHRC
Bashrc is read by bash, csh.cshrc is read by tcsh zshrc is read by zsh PROFILE This file is read by all shells except tcsh and csh upon login. /etc/profile System wide environment and startup programs profile is a good place to set paths because it is where you set environmental variables How many number of user commands saved in the .history file in their home directory. modify this line: HISTSIZE=1000 /etc/bashrc Functions and aliases 5
6
BASH, TCSH, ZSH AND THEIR CONFIG FILE READ ORDERS
The shells read a couple different configuration files when starting up. It is good to know which files are read in what order, so that you know where to set variables that will only apply to certain users. bash files on startup: /etc/profile, ~/.bash-->profile, ~/.bash-->login, ~/.profile. 1. 2. 3. 4. Upon logout, bash reads ~/.bash-->logout. 1. 6
7
System environmental settings
MOTD This file contains the message that users see every time they log in. DIR-->COLORS Red Hat Linux enables you to view file listings in color, as long as you are using a terminal program that supports colors. executable files are green, directories are dark blue, symlinks are light blue, regular files are white. ISSUE.NET Because it shows up to people who are connecting to your system over the Internet . Messages displayed Access is being monitored Unauthorized access is prohibited 7
8
ALIASES file /etc/mail/aliases is the aliases file for the sendmail program The aliases file sends mail for all the basic system accounts such as bin, daemon, and operator, to root‘s mailbox root: siddhu 8
9
DUMPDATES FSTAB LILO.CONF GRUB.CONF
If you do backups with dump, this file is important to you. dumpdates stores information about the last system backup that was done. FSTAB fstab contains important information about your file systems, such as what file system type the partitions are, where they are located on the hard drive, and what mount point is used to access them. LILO.CONF LILO is the boot time LInux LOader. GRUB.CONF grub stands for the modest acronym GRand Unified Bootloader. 9
10
CRON FILES cron is a daemon that executes commands according to a preset schedule that a user defines. User crontab files are stored in /var/spool/cron/. cron files are stored in the following subdirectories of /etc directory cron.d cron.daily cron.hourly cron.monthly cron.weekly By default, a file in cron.d called sysstat runs a system activity accounting tool every 10 minutes, 24 x 7.
11
SYSLOG.CONF LD.SO.CONF LOGROTATE.CONF
The syslog daemon logs any notable events on your local system It can store these logs in a local file or send them to a remote log host for added security. LD.SO.CONF This configuration file is used by ldconfig. ldconfig configures dynamic linker runtime bindings. It contains a listing of directories that hold shared libraries. Shared library files typically end with .so static library files typically end with .a LOGROTATE.CONF logrotate can automatically rotate, compress, remove, and mail your log files Log files can be rotated based on size or on time, such as daily, weekly, or monthly
12
System configuration files in the /etc/sysconfig directory
APMD apmd contains configuration information for the advanced power management daemon This is most useful for laptops rather than servers. CLOCK This file contains information on which time zone the machine is set to, and whether or not it is using Greenwich Mean Time for its system clock time. AMD amd is the file system automounter daemon. It automatically mounts an unmounted file system whenever a file or directory within that file system is accessed. UPS make it easier for the Linux system to communicate with your UPS when the UPS needs to shut down the system. 12
13
EXAMINING THE NETWORK CONFIGURATION FILES
Files to change when setting up a system or moving the system files need to be modified to get it working on the new network Set up the IP addresses of your network interfaces. Make changes to: /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth1 Set up the hostname of your machine. Make changes to: /etc/sysconfig/network /etc/hosts Set up a default gateway. Make changes to: /etc/default-route 13
14
Set up the DNS servers to reference. Make changes to:
/etc/resolv.conf Make a local file of hostname to IP address mappings. Make changes to: /etc/hosts Set up the device order from which hostnames are looked up. Make changes to: /etc/nsswitch.conf
15
SETTING UP THE IP ADDRESS
To set the IP address on your first Ethernet interface eth0, edit the /etc/sysconfig/network-scripts/ifcfg-eth0 file. IPADDR=‛ ‛ BROADCAST= NETMASK=‛ ‛
16
SETTING UP THE HOSTNAME
Once you‘ve picked your hostname, you need to put it into two different places: /etc/sysconfig/network /etc/hosts. This is the /etc/sysconfig/network file: NETWORKING=yes HOSTNAME=‛siddhesh‛ GATEWAY=‛ ‛ GATEWAYDEV=‛eth0‛ FORWARD_IPV4=‛yes‛ This is the /etc/hosts file siddhesh localhost.localdomain
17
SETTING UP A DEFAULT GATEWAY
you need to tell it where to send all its traffic. Ideally this would be a switch or a router that takes all your traffic in the direction of the Internet /etc/default-route file to contain just the IP address of the gateway, like this:
18
SETTING UP THE DNS SERVERS
Edit /etc/resolv.conf to contain a list of nameservers, like so: nameserver nameserver nameserver
19
MAKING A LOCAL FILE OF HOSTNAME TO IP ADDRESS MAPPINGS
Your /etc/hosts file should contain IP address to hostname mappings that follow this format: IP_address canonical_hostname aliases sid.weit.net sid
20
Starting up network services from xinetd
xinetd is Red Hat 7.1‘s replacement for inetd. xinetd is started on bootup listens on ports designated in the /etc/xinetd.conf for incoming network connections When a new connection is made, xinetd starts up the corresponding network service
21
Starting up network services from the rc scripts
Network services that are not started out of xinetd are started out of the rc scripts at boot time.
22
Network configuration files in the /etc/sysconfig directory
STATIC-ROUTES Used to set up some static routes on your machine IPTABLES iptables is the next generation Linux firewall. It supercedes the ipchains firewall IPCHAINS ipchains is a Linux firewall that is now being superceded by iptables. The GUI interface that configures the ipchains firewall rules is firewall-config utility. The ipchains rules are stored in the ipchains file.
23
Network configuration files in /etc/sysconfig/network-scripts
ifcfg-eth0 for your first Ethernet interface IFUP AND IFDOWN These files are symlinks to /sbin/ifup and /sbin/ifdown. call these scripts with the name of the interface that you want to bring up or down. ifup eth0 ifdown eth0 Managing the init Scripts The system boots into the default runlevel set in /etc/inittab File /etc/rc.d/rc.sysinit is an initialization file Directories for particular runlevel /etc/rc.d/rc.0 to rc.6 23
24
Managing rc scripts using chkconfig
It helps the system administrator manage rc scripts and xinetd configuration files without having to manipulate them directly. chkconfig servicename off|on|reset 24
25
THANK YOU 25
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.