LINUX PRACTICAL FILE[11]
LINUX PRACTICAL FILE[11]
LINUX PRACTICAL FILE[11]
Select the operating system as RedHat the Type will automaticallyget selected as Linux and Version as Red hat
(Virtual Box support no of operating system which you can select from, Typedrop down menu)
Now write the virtual machine name as you want or set it by default“Red Hat Enterprise Linux 6”.
Now Select the Hard disk space as 20GB and select Store virtual machineas single machine
Now you get the option that virtual machine is created with the followingsettings
Click on “customize Hardware” Select the memory size that is RAMyou want to allocate for RedHat virtual
machine (1 GB) click Next button.
Now select create a virtual hard drive to the new machine clickcreate button.
Your RedHat Virtual Box operating system drive is created. Now startthe RedHat by double-click on it or use
Start tab on menu bar.
Red hat installation starts from here. select “ Install or upgrade an existingsystem “ option and press enter. It is a
by default graphical installation option orit will automatically start in a while.
Here it will prompt for testing media before installation select “Skip” here
Select “Next”
Using the mouse select a language to use for the installation. The languagewe select here will become the
default language for the operation system once it is installed. Once you select the appropriate language click
“Next” button
Keyboard configuration :-
Select the correct layout type(for example U.S. english) for the keyboard we should prefer for the installation
and as the system default once the selection ismade, click “Next” to continue.
Now the system will find the hard disk space and need to re-initializefor creating directories. Select “re-
initialize” all option.
Now here we assign our Hostname change the hostname as you desire or letit be as localhost.localdomain
22.. Now select “Create Custom Layout” for manually creating Partitions
For Root :-
Select the option of create custom layout then create new partitions where mount
point is /(root) of type ext4 click on “force to be primary partitions” and give sizeas 10000 MB and click Ok
For Swap :- create new partitions where file system type is swap and size 4000 MB, click Ok
Now partitioning is complete. Click on “next”.
The following is tabular presentation of Disk Partition.Sr. No Mount Point File system type Size(MB)
1 /(root)Ext3/Ext4 10000 MB
2 -/swap 4000 MB
3 /boot Ext3/Ext4 2000 MB
Now before creating New Partition Table it will ask you to format Hard Disk.
Now it will ask for format and write changes to disk, click on “Write changesto disk”
Now here we can configure our boot loader. Click “Next ” for default setting
Now it gives you prompt for installation of Software. Select customize nowfor installation of set of
software and click on “Next”
Software selection:-
By default, the Red Hat Enterprise Linux installation process loadsa selection of software that is
suitable for a system deployed as a basic server. Note that this installation does not include a graphical
environment. To include a selection of software suitablefor other roles, click the radio button that corresponds to
one of the following options: Basic Server
This option provides a basic installation of Red Hat Enterprise Linux for use ona server.
Database Server
This option provides the MySQL and PostgreSQL databases.Web server
This option provides the Apache web server.Enterprise Identity Server Base
This option provides OpenLDAP and Enterprise Identity Management (IPA)to create an
identity and authentication server.Virtual Host
This option provides the KVM and Virtual Machine Manager tools to create a host
for virtualmachines.
Desktop
This option provides the OpenOffice.org productivity suite, graphical tools suchas the GIMP,
and multimedia applications. Software Development Workstation
This option provides the necessary tools to compile software on your Red HatEnterprise Linux
system.
This option provides only the packages essential to run Red Hat EnterpriseLinux. A minimal
installation provides the basis for a single-purpose server or desktop applianceand maximizes
performance and security on such an installation.
Click on Customize now and select following software.
Installation of Red hat is completed and ask for the reboot. Click on “Reboot”.
once the Red hat start it show the window saying few more steps are therefor basic configuration. Click on
“Forward”.
Here select “I agree to the license agreement” to proceed and click “Forward”.
Now it asks for software update as we don’t have the RHN No.Click “Forward” .
Click on “Forward” to finish update setup
Now we have to create Normal User for our system. Provide Username and password and click on “forward”.
The Root user is different from the user we created now. Root user has administrator rights and the user we
created is normaluser without administrative rights.
Date and Time Zone Configuration Nowselect the System date for the window,
Set your time zone by selecting the city closest to your computer'sphysical location. Click on the map to
zoom in to a particular geographical region of the world.
From here there are two ways for you to select your time zone: Using your mouse, click on the interactive map
to select a specificcity (represented by a yellow dot).
A red X appears indicating your selection.
You can also scroll through the list at the bottom of the screen to select yourtime zone. Using your mouse, click
on a location to highlight your selection.
If Red Hat Enterprise Linux is the only operating system on your computer, selectSystem clock uses UTC. The
system clock is a piece of hardware on your computer system. Red Hat Enterprise Linux uses the time zone
setting to determine the offset between the local time and UTC on the system clock. This behaviour is standard
for systems that use UNIX, Linux, and similar operating systems. Click Forward to proceed
Now it will gives you Error “Insufficient memory to configure kdump”.Click on Ok.
37.. Kdump is used for backup and recovery purpose
39. Now your RedHat Virtual Machine is ready for use. Select the RedhatVirtual Option from VM-Ware
Workstation.
Shutting Down
To shut down Red Hat Enterprise Linux, the root user may issue the
/sbin/shutdown command. The shutdown man page has a complete list ofoptions, but the two most common
uses are:
/sbin/shutdown -hnow and
/sbin/shutdown -r now
After shutting everything down, the -h option halts the machine, and the -roption reboots.
PAM console users can use the reboot and halt commands to shut down the system while in runlevels 1 through
5. For more information about PAM consoleusers, refer to the Red Hat Enterprise Linux Deployment Guide.
If the computer does not power itself down, be careful not to turn off thecomputer until a message appears
indicating that the system is halted.
Failure to wait for this message can mean that not all the hard drive partitionsare unmounted, which can lead to
file system corruption.
Practical no 2: Software Selection and Installation
RPM (Red Hat Package Manager) is a default open source and mostpopular package management utility for
Red Hat based systems like(RHEL, CentOS and Fedora).
The tool allows system administrators and users to
install, update, uninstall, query, verify and manage system softwarepackages in Unix/Linux operating systems.
The RPM formerly known as .rpm file, that includes compiled softwareprograms and libraries needed by the
packages.
This utility only works with packages that built on .rpm format.
Some Facts about RPM Package:
RPM is free and released under GPL (General Public License).
RPM keeps the information of all the installedpackages under /var/lib/rpm database.
RPM is the only way to install packages under Linux systems, if you’veinstalled packages using source code,
then rpm won’t manage it.
RPM deals with .rpm files, which contains the actual information about thepackages such as: what it is, from
where it comes, dependencies info, version info etc.
(The name of the packaged software, The version of the packaged software,The package's release number).
There are 5 basic modes of RPM:
Install : It is used to install any RPM package.
Remove : It is used to erase, remove or un-install any RPM package.
Upgrade : It is used to update the existing RPM package.
Verify : It is used to query about different RPM packages.
Query : It is used for the verification of any RPM package.
To install any package go to the Packages Folder:
# cd /media/RHEL_6.0\i386\Disc\1/Packages
Once you are in the Packages folder - Now you can run your rpm commands.
(1) Package Installation:
The basic syntax for installation with rpm (redhat package manager) is:[root@tyit ~]#rpm -ivh package [name
and version]
Following are rpm installation options:
-i : To install the package
-v : verbose it is to enable verbose and shows usefulmessages during installation.
-h : It prints during installation up to 50 hash (#) to illustrate the progress.
Example : rpm –ivh dhcp*
ifconfig :-
Practical no 3: Basic Command
Hostname:-
The #hostname command is used to change the hostnameSyntax:
#hostname <>
chmod:-
#chmod is used to give permission for a particular directory
mkdir :-
The mkdir is used to create a new directory
ls :-
The ls command is used to list all the files in a particular folder
ls-a :-
The ls-a command is used to list all files in a particular directory.
cat :-
The cat command is used to create a new file.Syntax:
cat>>[filename]
To save a file ctrl+d
Practical no 4: Introduction to Grub.conf
What is GRUB?
GRUB stands for Grand Unified Boot Loader.
On RedHat open the GRUB configuration file (/boot/grub/grub.conf) inany text editor as follows:
[root@tyit ~]#vim /boot/grub/grub.conf
grub to boot the default kernel after 5 seconds. The default timeout can be edited too.
Splashimage=(hd0,0)/grub/splash.xpm.gz - This line helps gub to identity the path of splash image it displays
for the menu. Although user can create hisown image but it has to be kept in the same path.
Hiddenmenu - This line tells the GRUB not to display the menu and to bootthe default kernel after the timeout
expires.
Title - This line helps GRUB to set title as boot name on the menu.
The lines following the title are :
Root (hd0,0) - This line instructs the GRUB to boot the system from thefirst partition o the first hard disk.
kernel /vmlinuz-2.6.18-8.el5 ro root=LABEL=/ rhgb quiet - Specifies the kernel location which is inside the
/boot folder as well as passes the parametersto the kernel. There are already two parameters i.e. rhgb tells the
system to usethe graphical boot whereas quite option tells the system to be quiet and not to display everything
that happens at the time of system boot.
initrd /initrd-2.6.18-8.el5.img - This line tells the GRUB location of the initial ramdisk image that is used to
load special drivers for the system duringboot process.
Practical no 5: Setting up Samba Server
Samba is basically used for establishing connection among linux to windows, with help of samba file sharing
can be done using Windows file-sharing protocol and connect your Red Hat Enterprise network to a windows
network toshare files and printers.
Windows use a protocol called Server Message Block (SMB) to communicatewith each other and to share
services such as file and print sharing.
With Samba, the Linux PC icon appears in the Windows Network Placeswindow and the files on the Linux PC
can be browsed using Windows Explorer.
The Windows File system can be mounted on your Linux System , and you canbrowse the Windows files from
your Linux PC.
Before using Samba to connect to the Windows computers, it must first beinstalled on the Linux PC.
All current distributions of Linux include three Samba packages:
Samba
Samba-client
Samba-common
Settings to be done in Windows
Go to “My Computer” -> “Network” -> Right Click on “Properties”
Go to the option “Change adapter settings” -> Right click on “VMWare Network Adapter VMnet1” -> Click
“IPV4” - > Click on “Properties” button ->Set IP Address Example : 192.168.1.1 -> Click “OK” -> Click
“Close”.
Right click on “VMWare Network Adapter VMnet8” -> Click “IPV4” - > Click on “Properties” button -> Set
IP Address Example : 192.168.1.2 -> Click “OK” ->Click “Close”.
Now Open “VMWare”– Linux Virtual machine Set the IP Address to 192.168.1.3To do so follow the
steps :
Right click on top of “Network symbol” -> Go to “Edit Connections” -
>Select “eth0” ->Click on “Edit” button -> Select IPV4 - >Select “Manual” .
Now set IP Address to 192.168.1.3
Set the Netmask as 255.255.255.0
The following package with the version number should be installed –“samba-3.5.4-68.el6.i686”.
Now go to your home directory:
# cd /home
Now create a directory and create few files into it. You can also write thecontents in the file.
This is a directory to be shared by samba.
mkdir tyit
Go inside tyit directory to create files intoit cd tyit (// change directory )
touch f1 f2 f3 (creating 3 files with touch command – 3 files (f1 , f2, f3) withzero byte size will be created)
Creating a file named as ‘test’ with cat command
cat > test
// Write the contents
Hello my First Samba file to be sharedPress <ctrl+d> to save the file.
Go to Insert mode -> press ‘ i ’ -> press Enter and now paste it at the end
To paste come out of Insert Mode – Press Esc Key -> press ‘p’
Save the configuration file - > Press Esc Key and type :wq
Now start the smb service#] service smb start
#] service smb restart
Stop Firewalls
# service iptables stop
#setsebool samba_enable_home_dirs=1
Now to check whether home directory is enabled:
# getsebool –a | grep samba
Close
Now to check whether files are been transferred from Samba toWindows Run - > \\192.168.1.3
It will prompt one dialog box asking for username and passwordEnter Username – test1
Enter Password - *********
DHCP, or Dynamic Host Configuration Protocol, allows an administrator to configure network settings for all
clients on a central server. The DHCP clients request an IP address and other network settings from the DHCP
server on the network. The DHCP server in turn leases the client an IP address within a given range or leases
the client an IP address based on the MAC address of the client's network interface card (NIC). The information
includes its IP address, along with the network's name server, gateway, and proxy addresses including the
netmask. Nothing has to be configured manually on the local system, except to specify the DHCP server it
should get its network configuration from. If an IP address is assigned according to the MAC address of the
client's NIC, the same IP addresscan be leased to the client every time the client requests one. DHCP makes
network administration easier and less prone to error.
Configure dhcp server
We will configure a dhcp server and will lease ip address to clients. we are usingtwo systems one linux server
one linux clients. dhcp rpm is required to configure dhcp server.
Step 1 :- First we have to check whether DHCP is available on our machine ornot that we can check with rpm
command.
#rpm –qa dhcp
Step 2:- If DHCP package is not installed. Use the following command toinstall DHCP Package.
First move to Package Folder.
#cd /media/RHEL/Package
#pwd
Output : -/media/RHEL/PackageNow install DHCP Package #rpm –ivh DHCP*
NOTE :- rpm is executable command which is use to run rpm command, I for
inux Administration Practical Manual
install,v for verbose, h for hash format output or human readable format.
Step 4:- Now check dhcpd service in system service it should beon #setup
Now a new window will show you all available LAN card select your LAN card( if you don't see any LAN card
here mean you don't have install driver)
Select Use DHCP Option and remove the [*] dhcpd option. now enter static IPAddress.
Click on OK, quit and again quit to come back on root prompt.
Step 5:- Restart the network service so new ip address can take place on LANcard To disable network we use
following command
#ifdown eth0
To disable network we use following command
#ifup eth0
Step 6 :- main configuration file of dhcp server is dhcpd.conf. This file locatedon /etc directory. If this file is not
present there or you have corrupted this file,then copy new file first, if ask for overwrite press “y”.
by default when you install DHCP Package it will create dhcpd.conf.sample filein /usr directory
(/usr/sample/doc/dhcp-4.1.2/dhcpd.conf.sample) now copy the file to /etc directory and replace with the old file.
#vi /etc/dhcp/dhcpd.conf
default entry is this file look like this.
Change option domain-name “example.org” to option domain-name“Your Machine Domain-name for e.g
tyit.com”
Change option domain-name-servers ns1.example.org, ns2.example.org; to option fully qualify domain-name-
server “Your Machine Domain-name for e.gserver.tyit.com”;
Step 8 :- Uncomment line no. 18 # authoritative (Remove # mark)
Authoritative says that the DHCP server is authenticated server and DHCP clientcan connect to DHCP server, if
the option is not uncommented the DHCP client not able to connect to DHCP Server.
Step 9 :- Comment Line No 27 and 28Change these lines no 32
Subnet 10.254.239.0 netmask 255.255.255.224
{
Range 10.254.239.10 10.254.239.20;
Option routers rtr-239-0-1.example.org,rtr-239-0-2.example.org
}
Following lines after changes
Subnet 198.168.1.0 netmask 255.255.255.0 (subnet ip is the first IP of yournetwork.)
{
Range 192.168.1.10 192.168.1.20; (Range means the range of IP Addressserver want to assign to DHCP Client)
#Option routers rtr-239-0-1.example.org,rtr-239-0-2.example.org }
Save the file.
#service dhcpd start #service dhcpd restart#chkconfig dhcp on #chkconfig –list dhcp #service iptables
stop #setenfor
DHCP Client
How to create Clone Machine :-
First stop DHCP server. Right click on DHCP server virtual machine.
Now Provide name to your Virtual Machine or set it default Clone of RedHat Enterprise Linux
Now our clone machine is ready to use. First start DHCP Server and thenstart Clone/client virtual machine.
ow we are on client machine and we will check whether through dhcp, ip address can be given to our client
machine or not before that we have to checkcurrently our machine is configured manual or dhcp. Through
wizard we will check on network
→ →
Right click on Network icon at right top corner on desktop- Edit Connection
Select system eth0
→ → →
Click on Edit button - select IPv4 setting option see the methodmanual Change it to DHCP
(Automatically)
# ifconfig
OR
This command is use to check network configuration and IP address.
#vi /etc/sysconfig/network-scripts/ifcfg-eth0 Change BOOTPROTO = dhcp
Save the file.
#service network restart
Now use ifconfig command to check whether dhcp client get the ip address andall network information from
dhcp client or not.
Practical No.7: Configuring DNS Server
Name address resolution is simply the conversion of people friendly namesinto computer friendly numbers.
It means that every interface on the network has a unique group of numberscalled as IP address.
These group of numbers present to the computers in the network but it isdifficult for the users to by heart, learn
or remember them.
DNS makes possible for the users to enter the names and then thes4e namesget converted into numbers.
The main function of name address resolution is to create an efficient userand computer interaction.
For this name address resolution there is need that how to install andconfigure the Domain Name System.
To understand, take a look on the domain and understand its working. Foreg. example.com.
In the above eg: The first part of the domain name is the name of the company or institution or an organization.
The next part after the period/dot is a called as top-level domain (TLD).
/sysconfig/network-script/ifcfg – etho
root@server ~]#vim /etc/hosts
1) dig server.tyit.com
2) dig -x 192.168.1.3
To check in the network,type thefollowing (i)ns lookup
>server.tyit.com
>192.168.1.3
>exit.
Practical no 8 : Configure a Linux Server and transferfiles to windows
client.(Setting up NFS File Server)
The Network File System (NFS) is a way of mounting Linux directoriesover a network. An NFS server can
export one or more directories that can then be mounted on a remote Linux machine.
The main use of NFS in the home context is to share out data on acentral server to all the PC’s in the house.
This way you can have a single copy of data accessible from acentral location.
The Network File System is the mostly used method for providingfile sharing services on Linux networks.
It enables local access to remote disks and file system in adistributed manner.
NFS uses a standard Client-Server architecture.
The NFS contains all those file systems that user wants to share alongwith daemon making those shares visible.
This way of sharing file by NFS is called as NFS exports.
The NFS server daemons provide remote access to the expected file system, enabling file locking over the
network and allows to enable diskquotas on the NFS exports.
On the Client side, NFS Client simply mounts the expected file systemlocally.
The mounted file system is known as NFS mount.Setting Up NFS Server:
Verify the package of NFS whether installed as shown below:
If not installed on your system, then execute the following command:
Make a directory to be exported, create few files into it and give itfull permission, as follows:
Open the configuration file of NFS, i.e, /etc/exports and writethe following lines under it:
[root@diamond ~] # vi /etc/exports.
The above entry says that server export directory has been exported to thenetwork 192.168.1.3
Save and quit the file. Restart the service of nfs and enable it fromboot as shown below :
Stop the ftp service - vsftpd services and NFS services clash with each other.
Give full permissions to the shared folder.
NFS Client:
As NFS Client make a directory /nfsclient and mount the server exporteddirectory on it, as shown:
If the package is not installed install with following command.move to Package Directory.
#cd /media/THEL_6.0\ i386\ Disc\ 1/Package
Now use rpm command to install SQUID Package.
#rpm –ivh squid*
Step 2 :- check the hostname and ip address of server it will be use in editing ofsquid.conf
#hostname#ifconfig
Main Squid configuration file is squid.conf in the /etc/squid/ directory. But only afew are active by default. Most
of this file is filled with comments that describe most directives and associated options.
To make editing easier use show line numbers options and locate desire tag fromline number.( set the line
numbers by :set nu)open /etc/squid/squid.conf for editing.
#Vi /etc/squid/squid.conf
Squid.conf file
Insert to Line no 34 write acl deny_host src 192.168.1.14
The above line deny access to IP Address 192.168.1.14 network.Insert Line no 35 write acl allow_network src
192.168.1.0/24
The above line allow to 192.168.1.all network IP to access internet via192.168.1.1 server.
Insert Line no 36 write acl web_deny dstdomain “/etc/squid/web_deny” The above line block access to web site
enter in web deny file. At presentthe web_deny file is not there we have to create that file.
Now we apply above acl rules. Go to line no .55 and insert following line afterline No. 55
:wq
Save the file.
Now we create web_deny file which we declare at line no. 36. At /etc/squid directory. Open thefile with
command # vi /etc/squid/web_deny and add web site name www.yahoo.com
So we should edit the /etc/mail/sendmail.mc file to allow connect to other hosts.To open the configuration file of
sendmail, the command is as follows:
# vim /etc/mail/sendmail.mc
Show hidden line with :se nu option on vi editor command mode.Go to line number 116
DAEMON_OPTIONS (‘Port = smtp , Addr =192.168.1.1, Name=’MTA’)
You can allow other computers to use your sendmail server by commenting.
In the sendmail.mc file, lines that begin with dn1 , which stands to delete newline are constant.
Some lines end with dn1, but lines ending with dn1 are not comments.
Comment this line with dn1 keyword followed by # sign
dn1 # DAEMON_OPTIONS (‘Port = smtp , Addr =192.168.1.1
, Name=’MTA’)
Save this file with :wq and Exit
Now generate new sendmail.cf file by using m4 command as shown below.
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
m4 is a macro processor i.e. a tool that follows principle of shorthand writing.Macro is a symbolic link for a
long string of characters.
If sendmail service restart without any error means you have configuredsendmail successfully.
Type su – test
The above command switch to the user name test.To check whether mailhas received or not , type mail
command
# mail
The above command open the mailbox for the current login user.It will giveyou the details of mail received by
the subject name.
New emails are shown with letter N at starting and unread mail shown with letter U at starting. Once you read
the mail U and N notification get cleared.
To read that mail type the number which will be given in previous output
#1
You can now read the contents of mail.To exit type <Ctrl+d>
Practical no 10: Configure FTP Server on Linux server
To verify that the server is running, use the command service vs ftpd status.
Verify the package vsftpd for FTP. If installed create few files in pub. itis shown below.
#rpm –qa | grep vsftpd
This command returns the version of vsftpd.If package vsftpd is not installedthen install using following
command.
#rpm – ivh vsftpd*#rpm –ivh ftp*
Check whether the package is install or not with #rpm –qa | grep ftp command
Now use following command to start vsftpd services at boot time usingchkconfig command.
# chkconfig vsftpd on
#vi /etc/vsftpd/vsftpd.conf
Once the file is open do the above changes to configuration file And restartthe vsftpd service.
#service vsftpd restart
Restart the service of vsftpd and enable it fromboot. Also give full permission to the directory
/var/ftp/pub. service vsftpd start#service vsftpd restart #chkconfig vsftpd on #chkconfig –list | grep vsftpd
Now FTP is configure.Test as FTP client from other machine.
Use the following command.
#ftp 192.168.1.1
It will prompt for username and password. If your using ftp as username it willnot prompt for password as ftp is
anonymous user
Disabling anonymous FTP login :
Same way create one text file in your current directory and try to upload thesame with put command.
ftp> put test_new.txt
To exit from ftp use bye command.
Practical No 11 : Configuring Apache Web Server In Linux
When you view a web page over the Internet, the code to create thatpage must be retrieved from a server
somewhere on the Internet.
The server that sends your web browser the code to display a web pageis called a web server.
There are countless web servers all over the Internet servingcountless websites to people all over the world.
Whether you need a web server to host a website on the Internet a RedHat Enterprise Linux server can function
as a web server using the Apache HTTP server.
The Apache HTTP server is a popular, open source server application that runs on many UNIX-based systems
as well as Microsoft Windows.
Since we had created DNS named as server.nm.com but on Linux browserit is showing unable to connect
because we need to configure apache web server , so that we can display out html page on web browser with the
helpof our own DNS server.nm.com
Configure web server
We will configure a web server. The necessary rpm for web server is httpd,httpd-level and check them for
install.
The above command give you the version no and name of package. Now configure the IP address to
192.168.1.1 and check it#ifconfig eth0 192.168.1.1
#ifconfig
start httpd daemons and verify its running status
#chkconfig httpd on #service httpd start #service httpd status Configure virtual hosting
In this example we will host a website www.nm.com to apache web server.Create a documents root directory
for this website and a index page
#mkdir –p /var/www/virtual/www.svkm.com/html
#vim /var/www/virtual/www.svkm.com/html/index.html
for testing purpose we are writing basic html code in its index page.
<html>
<head>
<title> Linux Apache Website</title>
<body>
Today we complete Apache web server practical.
</body>
</head>
</html>
Save file : wq and exitCheck IP Address:-
You have done necessary configuration now restart the httpd service and testthis configuration run links
command.
#service httpd restart
chmod –R 777 /var/www/virtual/www.svkm.com/html
Go to the Clone and open browser andtype server.svkm.com OR 192.168.1.1 You can view your web page.
#links 192.168.1.1
If links command retrieve your home page means you have successfully configured the virtual host now test it
with site name.
#links www.svkm.com
In output of links command you should see the index page of site
Practical no 12: Linux System Administration
Becoming super user:
Create a user account to grant him the privilege of superuser, as shown below:
Open the file /etc/sudoers and the following lines forsmith: MITH ALL = (ALL) ALL
It is as shown below:
#visudo Test the configuration by making smith to login andperform any administrative
activity as shown below:
Add user Jackson using sudo:
But when any local user tries to change the identitytemporarily, redhat system asks for the password as shown
below:
Administrative Commands:
useradd command with its options:
The file /etc/passwd also shows the entry of the user as follow:
chage command to change the age of user’s password :
Groupadd command to create a new group and gpasswd command to add members and administrator inthe
group:
rpm:
The packages can be installed with the help of rpm command. For that purpose, we need to mount disk image of
RedHat on linux machine. Afterinstallation, this disk image is already mounted. We can simply switch to it
under media. It is as shown in the screenshot.,
The directory Packages has all the packages. For eg, to install vsftpd,use rpm command with ‘i’ option to install.
To query and verify use rpmquery or rpm -qa, as shown below:
Shutdown command:
To shutdown after 5 mins:
Administrative Files:
/etc/aliases (will be done in sendmail)
/etc/passwd
/etc/shadow
/etc/motd
/etc/issue
Graphical Tools:
To add user graphically:
Useradd dialog box comes. Write username, full name, password, shellname, home dir and click OK.
To add a group graphically, system->Administration->user.Click add group and provide the group name. Click
OK.