+ All Categories
Home > Documents > Seculabs eBook - Complete Linus Servers - Installation and Configuration

Seculabs eBook - Complete Linus Servers - Installation and Configuration

Date post: 14-Apr-2018
Category:
Upload: rifqi-multazam
View: 221 times
Download: 1 times
Share this document with a friend
94
Transcript
Page 1: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 1/94

Page 2: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 2/94

 

SECUGENIUS SECURITY SOLUTIONS 

--------------------------------------------------------------------------------------

(A UNIT OF HARKSH TECHNOLOGIES PVT. LTD)

Company Profile:

Secugenius Security Solutions is a Student Entrepreneurial Company started by 2 Social Student

Entrepreneurs in 2010 with an aim to make our country Cyber Crime Free. We at SECUGENIUS

are headquartered at Ludhiana, the Manchester of Punjab. The main activities of Secugenius

Security Solutions are providing training in Information Security and various professional courses.

Secugenius Security Solutions is an organization which believes in inventing and implementing newideas to influence the technological minds of the youngsters

Looking at the number of Cyber Crimes since last many years, We at Secugenius Security

Solutions provides training on Ethical hacking & Cyber Security to students, IT Professionals, Bank 

Employees, Police officials.

Secugenius conducts workshops in all parts of the country in various Colleges/institutions for the

benefit of the students & making them aware of the latest trends in technological era of the

Computer age. We believe in spreading knowledge to all the youngsters & growing minds of the

nation so that they could serve the nation with perfect skill-sets in the field of Cyber Crime

Investigation & Forensic Sciences

Secugenius provides various security solutions to its clients by securing their websites from cyber

attacks. We provide training to college students, graduates and professionals in various fields.

Education is delivered to students through two modes i.e. Regular mode and Distance mode which

are available as short term and long term courses.

In the workshops conducted by Secugenius, participants can claim to be trained by the highly

experienced & skilled corporate trainers from different parts of the nation. We believe in making

the base of students to be as strong as possible. All the modules have been designed in order to

provide students with specialized knowledge by specialized trainers.

This library was furnished, managed and funded by the Founders and Directors of Secugenius

Er. Harpreet Khattar & Er. Kshitij Adhlakha. The overall resource person for the content of 

the series of this Digital Library is Er. Chetan Soni - Sr. Security Specialist, Secugenius Security

Solutions.

This Online Digital Library has been initiated as a free resource & permanent

resource on specialization basis for every student of Team Secugenius.

Page 3: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 3/94

 

Complete Linux Servers  – Installation & Configuration

Product ID No: SG/ODL/13050

Founder & Director: Harpreet Khattar & Kshitij Adhlakha

Resource Person: Chetan Soni

Secugenius Security Solutions 

SCO-13A, Model Town Extn, Near Krishna Mandir,

Ludhiana-141002, Punjab – India

[email protected][email protected] 

www.secugenius.com , www.seculabs.in 

NFS, FTP,

Page 4: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 4/94

 

Introduction To LINUX Administration:-

With the role of an IT professional not restricted to one technology alone, theindustry requires one to have all-round knowledge of computer hardware & networkingconcepts and technologies The average salaries of such network professionals which

have done a complete course range to more than $90,000 per annum.

The course creates great job prospects for the candidates who have a keeninclination towards making their career in managing IT Infrastructure along with theirgraduation such that when they complete the course with graduation they are industryready and the most sought after professionals. 

1. Basic Hardware and Server Technology2. Advanced Networking and Security3. System Engineering on Microsoft Technologies4. Networking Technology & Devices5. Linux Administration & Security (RHCE)6. Notebook Technology.7. Wireless Network Administration.

In late 1991, Torvalds published the first version of this kernel on theInternet, calling it "Linux" (a play on both Minix and his own name).

When Torvalds published Linux, he used the copy left software license published by theGNU Project, the GNU General Public License. Doing so made his software free to use,

copy, and modify by anyone--provided any copies or variations were kept equally free.Torvalds also invited contributions by other programmers, and these contributions came;slowly at first but, as the Internet grew, thousands of hackers and programmers fromaround the globe contributed to his free software project.

General Overview of the RedHat File System

The simplest description of the Unix system, which is generally applicable to Linux andRedHat, is:

"On a Unix system, everything is a file. If it is not a file, it is a process." 

This is partially true, because there are special files that are more than just files(named pipes and sockets, for instance), but to keep things simple, saying thateverything is a file is an acceptable generalization. A Linux system, just like UNIX, makesno difference between a file and a directory, since a directory is just a file containingnames of other files. Programs, services, texts, images, etc. are all files. Input and outputdevices, and generally every device, is considered to be a file, according to the system.

In order to manage all those files in an orderly fashion, we like to think of them as an ordered tree-like structure on the hard disk, relating back to DOS. There arethen big branches containing more branches, and the branches at the end contain thetree leaves or normal files. For now, we will stick to this image of the tree, but we willfind out later why it is not actually an exact image.

Page 5: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 5/94

 

Sorts of files

Most files are just files, called regular files: they contain normal data, e.g. textfiles, executable files or programs, input for or output from a program, etc.

While it is reasonably safe to suppose that everything you encounter on a Linux system is

a file, there are some exceptions.

  Directories: files that are lists of other files.

  Special Files: the mechanism used for input and output. Most special files are in /dev

  Links: a system to make a file or directory visible in multiple parts of the system's filetree.

  (Domain) Sockets: a special file type, similar to TCP/IP sockets, providing inter-processnetworking protected by the file system's access control.

PartitioningMost people have a vague feeling about what a partition is, since almost

every operating system has the possibility to create them. The fact that Linux uses morethan one partition on the same disk, even when using the standard installationprocedure, may seem strange at first.

The goal of having different partitions is to achieve higher data security incase of a disaster. By dividing the hard disk in partitions, data can be grouped andseparated. When an accident occurs, e.g. an electricity failure, the optical reader maycrash into the hard disk. Only the data in the partition that got hit will be damaged, while

the data on the other partitions will most likely survive. Imagine the tree again; whenlightening should break off one branch, the rest of the tree grows on.

This principle dates from the days when Linux didn't have ―journaled‖ filesystems yet. A (V) 15 uses RedHat 6.2 and does not journal, but the use of partitionsremains for security reasons, so a security breach on one part of the system doesn'tautomatically mean that the whole computer is in danger.

There are two kinds of major partitions on a Linux system:

  Data Partition : normal Linux system data, including the root partition  containing all the data to start up and run the system; and

  Swap Partition : expansion of the computer's physical memory, extra memoryon hard disk.

On a server system, system data tends to be separated from user data.Programs that offer services are kept in a different place than the data handled by thisservice.

Different partitions will be created on such systems, e.g. a partition with all data

necessary to boot the machine, a partition with configuration data and server programs,one or more partitions containing the server data, e.g. a database, user mails, an ftparchive etc., a partition with user programs and application and one or more partitions forthe user specific files. Servers usually have more memory and thus more swap.

Page 6: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 6/94

 

Certain server processes, such as databases, may require more swap space than usual,see the specific documentation for detailed information. For better performance, swap isoften divided into different swap partitions.

File System Layout

For convenience, the Linux file system is usually thought of as a treestructure, you will find the layout generally follows the scheme.

The tree of the file system starts at the trunk or slash , indicated by aforward slash (/). This directory, containing all underlying directories and files, is alsocalled the root directory or "the root" of the file system Directories that are only one levelbelow the root directory are often preceded by a slash, to indicate their position andprevent confusion with other directories that could have the same name.

Servers in Details  – 01.  NFS Server02.  FTP Server03.  DHCP Server04.  SAMBA Server05.  SQUID Server

06.  DNS Server07.  MAIL Server08.  TELNET Server09.  SSH Server10.  SYSLOG Server11.  NIS Server12.  WEB Server

13.   VNC Server14.  PRINTER Server15.   YUM Server

Page 7: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 7/94

 

I)  NFS Server

NFS, or Network File System, is a server-client protocol for sharing filesbetween computers on a common network. NFS enables you to mount a file system on aremote computer as if it were local to your own system. You can then directly access any

of the files on that remote file system. The server and client do not have to use the sameoperating system. The client system just needs to be running an NFS client compatiblewith the NFS server.

For example, NFS server could be a Linux system and UNIX could be a client. Butit can’t be a window system because window is not NFS compatible. The NFS serverexports one or more directories to the client systems, and the client systems mount oneor more of the shared directories to local directories called mount points. After the shareis mounted, all I/O operations are written back to the server, and all clients notice thechange as if it occurred on the local filesystem.

 A manual refresh is not needed because the client accesses the remote filesystem as if itwere local, because access is granted by IP address; a username and password are notrequired. However, there are security risks to consider because the NFS server knowsnothing about the users on the client system.

1. Configure NFS Server

In this example we will configure a nfs server and will mount shared directory fromclient side.

For this example we are using two systems one Linux server one Linux clients.To complete these per quest of nfs server follow this link 

a)  Per quest of nfs server

   A linux server with ip address 192.168.0.254 and hostname Server.   A linux client with ip address 192.168.0.1 and hostname Client1.  Updated /etc/hosts file on both linux system.  Running portmap and xinetd services. 

Firewall should be off on server.

We have configured all these steps in our pervious article.

b)  Necessary Configuration for NFS Server

We suggest you to review that article before start configuration of nfs server. Once youhave completed the necessary steps follow this guide.

Three rpm are required to configure nfs server. nfs, portmap, xinetd check them if not found then install.

Page 8: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 8/94

 

Now check nfs, portmap, xinetd service in system service it should be on  

#setupSelect System service from list[*]portmap[*]xinetd[*]nfs

Now restart xinetd and portmap service 

To keep on these services after reboot on then via chkconfig command 

 After reboot verify their status. It must be in running condition 

Now create a /data directory and grant full permission to it 

Now open /etc/exports file 

Page 9: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 9/94

 

Share data folder for the network of 192.168.0.254/24 with read and write access 

Save file with :wq! and exit 

Now restart the nfs service and also on it with chkconfig 

 Also restart nfs daemons with expotfs 

Verify with Showmount Command that you have successfully Shared Data Folder 

2. Configure Client System

Ping Form NFS Server and Check the Share Folder 

Page 10: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 10/94

 

Now Mount this Share Folder on /mnt Mount Point.To Test this Share Folder Change Directory to /mnt and Create a Test File.

 After use you should always unmount from mnt Mount Point.

In this way you can use shared folder. But this share folder will be available till

system is up. It will not be available after reboot. To keep it available after reboot makeits entry in fstab 

Create a Mount Point, by Making a Directory 

Now Open /etc/fstab File 

Make Entry for NFS Shared Directory and Define /temp to Mount Point 

Save the with :wq and Exit Reboot the system with reboot -f command 

#reboot  –f 

 After Reboot Check /temp Directory It Should Show all the Shared Data 

Page 11: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 11/94

 

Page 12: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 12/94

 

In Short: 

1.  Packages Required: nfs-utils-0.1.6-2.i386.rpm 

2.  Services in NFS: Portmap & NFS 3.  Procedure :

a)  First Insert the DVD into DVD-Rom & Mount this DVD into your System- mount /dev/dvd

 /mnt

b)  Create Directory named as /dump.

c)  Copy-Paste the RedHat DVD into ur system named as /dump - cp –rf /mnt/* /dump/

d)  Now Install the createrepo Package from your /dump Directory by rpm command

rpm –ivh /dump/Server/createrepo* --force –nodeps

e)  After finishing this command type

createrepo –v /dumpf)  Now open two Configurations Files

1.  vi /etc/yum.repos.d/rhel-debuginfo.repo

2.  vi /etc/exports

g)  Open First Configuration File and Write these Lines:

[Redhat]name=Redh

at 5.3baseurl

=file:///dumpenabled = 1gpgcheck 

=0

h)  Open Second Configuration File and Write these Lines:

 /dump *(rw,sync)

i)  Now Start the Services

Service portmap restart & Service nfs restart

 j) 

On Daemon ServiceChkconfig portmap on

Chkconfig nfs on

k)  Check the status of NFS service weather it is starting or not

Service nfs status

l)  For checking Sharing Directory into Your System:

Showmount –e 192.168.1.10 (Client IP address)

m) For checking Sharing Directory into Another System:

Showmount –e 192.168.1.254 (Server IP address)

Page 13: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 13/94

 

II)  FTP Server

1.  Introduction

The File Transfer Protocol (FTP) is used as one of the most common means of copying files between servers over the Internet. Most web based download sites use thebuilt in FTP capabilities of web browsers and therefore most server oriented operatingsystems usually include an FTP server application as part of the software suite. Linux isno exception.

2.  FTP Overview

FTP relies on a pair of TCP ports to get the job done. It operates in twoconnection channels as :

FTP Control Channel, TCP Port 21 : All commands you send and the ftp server'sresponses to those commands will go over the control connection, but any data sent back (such as "ls" directory lists or actual file data in either direction) will go over the dataconnection.

FTP Data Channel, TCP Port 20 : This port is used for all subsequent data transfersbetween the client and server.

In addition to these channels, there are several varieties of FTP.

Types of FTP

From a networking perspective, the two main types of FTP are active and passive.

In active FTP, the FTP server initiates a data transfer connection back to the client.

For passive FTP, the connection is initiated from the FTP client.

From a user management perspective there are also two types of FTP: regularFTP in which files are transferred using the username and password of a regular user FTPserver, and anonymous FTP in which general access is provided to the FTP server using awell known universal login method.

Page 14: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 14/94

 

 Active FTP

The sequence of events for active FTP is:

1.  Your client connects to the FTP server by establishing an FTP control connection to port21 of the server. Your commands such as 'ls' and 'get' are sent over this connection.

2.  Whenever the client requests data over the control connection, the server initiates datatransfer connections back to the client. The source port of these data transferconnections is always port 20 on the server, and the destination port is a high port(greater than 1024) on the client.

3.  Thus the ls listing that you asked for comes back over the port 20 to high port connection,not the port 21 control connection.

FTP active mode therefore transfers data in a counter intuitive way to the TCPstandard, as it selects port 20 as it's source port (not a random high port that's greaterthan 1024) and connects back to the client on a random high port that has been pre-negotiated on the port 21 control connection.

Passive FTP

Passive FTP works differently:

1.  Your client connects to the FTP server by establishing an FTP control connection to port21 of the server. Your commands such as ls and get are sent over that connection.

2.  Whenever the client requests data over the control connection, the client initiates thedata transfer connections to the server. The source port of these data transferconnections is always a high port on the client with a destination port of a high port onthe server.

Page 15: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 15/94

 

Passive FTP should be viewed as the server never making an active attempt to connectto the client for FTP data transfers. Because client always initiates the requiredconnections, passive FTP works better for clients protected by a firewall.

 As Windows defaults to active FTP, and Linux defaults to passive, you'll probably have toaccommodate both forms when deciding upon a security policy for your FTP server.

Regular FTP

By default, the VSFTPD package allows regular Linux users to copy files to andfrom their home directories with an FTP client using their Linux usernames andpasswords as their login credentials.

 VSFTPD also has the option of allowing this type of access to only a group of Linux users,

enabling you to restrict the addition of new files to your system to authorized personnel.

The disadvantage of regular FTP is that it isn't suitable for general download distributionof software as everyone either has to get a unique Linux user account or has to use ashared username and password. Anonymous FTP allows you to avoid this difficulty.

 Anonymous FTP

 Anonymous FTP is the choice of Web sites that need to exchange files withnumerous unknown remote users. Common uses include downloading software updates

and MP3s and uploading diagnostic information for a technical support engineers'attention. Unlike regular FTP where you login with a preconfigured Linux username andpassword, anonymous FTP requires only a username of anonymous and your emailaddress for the password. Once logged in to a VSFTPD server, you automatically haveaccess to only the default anonymous FTP directory (/var/ftp in the case of VSFTPD) andall its subdirectories.

In Practical:

FTP Server is used to transfer files between server and clients. All majoroperating system supports ftp. Ftp is the most used protocol over internet to transfer files.Like most Internet operations, FTP works on a client/ server model. FTP client programscan enable users to transfer files to and from a remote system running an FTP serverprogram.

 Any Linux system can operate as an FTP server. It has to run only the serversoftware —an FTP daemon with the appropriate configuration. Transfers are madebetween user accounts on client and server systems. A user on the remote system has tolog in to an account on a server and can then transfer files to and from that account'sdirectories only.

Page 16: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 16/94

 

 A special kind of user account, named ftp, allows any user to log in to it with theusername  “anonymous.”  This account has its own set of directories and files that areconsidered public, available to anyone on the network who wants to download them.

The numerous FTP sites on the Internet are FTP servers supporting FTP useraccounts with anonymous login. Any Linux system can be configured to supportanonymous FTP access, turning them into network FTP sites. Such sites can work on anintranet or on the Internet.

a) Configuring the ftp Server

The vsftpd RPM package is required to configure a Red Hat Enterprise Linuxsystem as an ftp server. If it is not already installed, install it with rpm commands asdescribed in our pervious article. After it is installed, start the service as root with the

command service vsftpd start. The system is now an ftp server and can acceptconnections. To configure the server to automatically start the service at boot time,execute the command chkconfig vsftpd on as root. To stop the server, execute thecommand service vsftpd stop. To verify that the server is running, use the commandservice vsftpd status.

b) Configure vsftpd server

In this example we will configure a vsftpd server and will transfer files from client side. 

For this example we are using three systems one Linux server one Linux clients and onewindow xp clients. To complete these per quest of ftp server follow this link 

(i)  Per Quest of vsftpd Server

   A Linux server with ip address 192.168.0.254 and hostname Server    A Linux client with ip address 192.168.0.1 and hostname Client1    A window client with ip address 192.168.0.2 and hostname Client2   Updated /etc/hosts file on both Linux system   Running Portmap and xinetd services   Firewall should be off on server 

We have configured all these steps in our pervious article.

(ii)  Necessary Configuration for vsftpd Server

We suggest you to review that article before start configuration of ssh server. Once youhave completed the necessary steps follow this guide.

Three rpm are required to configure ssh server. vsftpd, portmap, xinetd check them if not found then install 

Page 17: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 17/94

 

Now check vsftpd, portmap, xinetd service in system service it should be on  

#setupSelect System service from list[*]portmap[*]xinetd[*]vsftpd

Now restart xinetd and portmap and vsftpd service 

To keep on these services after reboot on then via chkconfig command 

 After reboot verify their status. It must be in running condition 

Create a Normal user Named vinita 

Page 18: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 18/94

 

Login for this user on Other Terminal and Create a Test File 

 On Linux client

Ping From Ftp Server and Run Ftp Command and Give Username and Password.

 After Login you can Download Files From the Specified Directories 

Most commonly commands used on ftp Prompt are: 

put To upload files on server get To download files from server  mput To upload all files mget To download all files  ? To see all available command on ftp prompts  

cd To change remote directory  lcd To change local directory  

Page 19: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 19/94

 

  On Window Client

Now go on window clients and create a file. copy con command is used to create files on window. To save use CTRL+Z 

Now ping from ftp server and invoke ftp session from server, login from user account and download as well as uploads files 

Enable root account for ftp session and set permission on user 

By default on vsftpd server root account is disable.You cannot login from root account.

Now we will enable root account for ftp session and same time we will disable 

our normal user vinita to use ftp sessions.

Page 20: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 20/94

 

Open file /etc/vsftpd/ftpusers . Users whose name are set in this file will not allowed to login from ftp.

By default this file have an entry for root that why root are not allowed to use ftp. remove root from list and add user vinita 

Now remove entry form /etc/vsftpd/user_list files.

Users whose names are set in this file are also not allowed to login from ftp even they are not prompt for password.

By default this file have an entry for root that way root is denied form login even not asked for password remove root from list and add user chetan 

Page 21: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 21/94

 

 After saving change in these files Restart the vsftpd service 

Now go on Client System and Login from root this time root will login 

Now try to login form user vinita He should not prompt form password also 

  How to set login banner for ftp server

To Set Login Banner Open /etc/vsftpd/vsftpd.conf file and Search for this tag 

Uncomment this Tag and Set your Banner and Save File , and Restart the vsftpd Service 

Page 22: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 22/94

 

Go on Client System and Check Banner It will appear before User Login.

Page 23: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 23/94

 

In Short: 

1.  Packages Required: vsftpd-1.2.1-5.i386.rpm 

2.  Services in FTP: Portmap & Vsftpd 3.  Procedure :

a)  First Insert the DVD into DVD-Rom

b)  Mount this DVD into your System- mount /dev/dvd /mnt

c)  Create Directory named as /dump.

d)  Copy-Paste the Redhat DVD into ur system - cp –rf /mnt/* /dump

e)  Now Install the createrepo Package from ur /dump Directory by rpm command

rpm –ivh /dump/Server/createrepo* --force –nodeps

f)   After finishing this command type

createrepo –v /dumpg)  Now open two Configurations Files

1.  vi /etc/yum.repos.d/rhel-debuginfo.repo

2.  vi /etc/exports

h)  Open First Configuration File and Write these Lines:

[Redhat]name=Redh

at 5.3baseurl

=file:///dumpenabled = 1gpgcheck 

=0

i)  Open Second Configuration File and Write these Lines:

 /dump *(rw,sync)

 /pub *(rw,sync)

 j)  Now Start the Services

Service portmap restart

Service vsftpd restartk)  On Daemon Service

Chkconfig portmap on

Chkconfig vsftpd on

l)  Check the status of NFS service whether it is starting or not

Service vsftpd status

m) For checking Sharing Directory into Your System:

Showmount –e 192.168.1.10 (Client IP address)

n)  For checking Sharing Directory into Another System:

Showmount –e 192.168.1.254 (Server IP address)

Page 24: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 24/94

 

o)  Give Full Permissions to these Two Directories:

Chmod 777 /dumpChmod 777 /var/ftp/pub

p) Now Open FTP of your Own Linux System

[root@chetan ~]# ftp 192.168.1.10 

Connected to 192.168.1.10 (192.168.1.10)220 ready, dude (vsFTPd 1.1.0: beat me, break me)Name (192.168.1.10:root): ftp331 Please specify the password.Password:230 Login successful. Have fun.Remote system type is UNIX.Using binary mode to transfer files.

ftp>q)  To download File from Ftp

Get filename  r)  To Upload File in FTP

Put filename s)  There are two default FTP Users

ftp and Anonymoust)  Open Configuration File for FTP Server:

vi /etc/vsftpd/vsftpd.conf 

# Allow anonymous FTP?anonymous_enable=YES...# The directory which vsftpd will try to change# into after an anonymous login. (Default = /var/ftp)anon_root=/data/directory...# Uncomment this to allow local users to log in.local_enable=YES...# Uncomment this to enable any form of FTP write command.# (Needed even if you want local users to be able to upload files)write_enable=YES

...# Uncomment to allow the anonymous FTP user to upload files.. . . . . . . . .. . . . . . . . .

u)  We can Also Login from local User in FTP by changing this configuration File: Vi /etc/passwd

Page 25: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 25/94

 

III) DHCP Server

Dynamic Host Configuration Protocol (DHCP) automatically assigns IPaddresses and other network configuration information (subnet mask, broadcast address,

etc) to computers on a network.

 A client configured for DHCP will send out a broadcast request to theDHCP server requesting an address. The DHCP server will then issue a "lease" and assignit to that client. The time period of a valid lease can be specified on the server.

DHCP reduces the amount of time required to configure clients andallows one to move a computer to various networks and be configured with theappropriate IP address, gateway and subnet mask. For ISP's it conserves the limitednumber of IP addresses it may use. DHCP servers may assign a "static" IP address to

specified hardware.

Microsoft NetBios information is often included in the network information sent by the DHCP server.

DHCP, or Dynamic Host Configuration Protocol, allows an administrator toconfigure network settings for all clients on a central server.

The DHCP clients request an IP address and other network settings from the DHCPserver 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'snetwork interface card (NIC). The information includes its IP address, along with thenetwork's name server, gateway, and proxy addresses, including the netmask.

Page 26: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 26/94

 

Nothing has to be configured manually on the local system, except to specify the DHCPserver it should get its network configuration from. If an IP address is assignedaccording to the MAC address of the client's NIC, the same IP address can be leased tothe client every time the client requests one. DHCP makes network administration easierand less prone to error.

Exam Question Configure the DHCP server by matching the following conditions: 

  Subnet and netmask should be 192.168.0.0 255.255.255.0    Gateway Should be 192.168.0.254   DNS Sever Should be 192.168.0.254   Domain Name should be example.com   Range from 192.168.0.10-50 

Exam Question You have DHCP server, which assigns the IP, gateway and DNS server ip to Clients. There is one DNS servers having MAC address (00:50:FC:98:8D:00 in your LAN, But it always required fixed IP address (192.168.0.10). Configure the DHCP server to assign the fixed IP address to DNS server.

1) Configure DHCP Server

In this example we will configure a dhcp server and will lease ip address to clients.

For this example we are using three systems one linux server one linux clients and onewindow clients.

DHCP rpm is required to configure DHCP Server. Check it if not found then install 

Now check dhcpd service in system service it should be on  #setupSelect System service from list[*]dhcpd

2) To Assign to DHCP Server.

DHCP server have a static a IP Address. First configure the ip address 192.168.0.254 with netmask of 255.255.255.0 on server.

Run setup command form Root User. 

#setup 

Page 27: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 27/94

 

This will launch a new Window Select Network Configuration  

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)  

 Assign IP in this Box and Click OK. 

Page 28: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 28/94

 

click on ok, quit and again quit to come back on root prompt.

Restart the Network Service so new IP Address can Take place on LAN card 

#service network restart

Main configuration file of DHCP server is dhcpd.conf.

This file located on /etc directory. If this file is not present there or you havecorrupted this file, then copy new file first, if ask for overwrite press y 

Now Open /etc/dhcpd.conf 

Default Entry in this file look like this 

Make these Change in this file to Configure DHCP Server.

remove this line# - - - default gateway  set option routers to192.168.0.254  set option subnet-mask to255.255.255.0  

option nis domain toexample.com  option domain-name toexample.com  option domain-name-servers to192.168.0.254  range dynamic-bootp to192.168.0.10 192.168.0.50; 

Page 29: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 29/94

 

 After change this file should look like this 

3)  Assign fix IP Address to any Host

Locate this Paragraph and Change Hardware Ethernet to Client's Mac Address and fixed -address to IP Address which you want to provide that host.

 After making Necessary Change Save File and Exit.Now Create a Blank File use to store the allocated IP Address Information 

Now Restart HDCP service and on it with chkconfig Commands. 

Page 30: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 30/94

 

4) Linux Client configuration

Client Configuration is very easy and Straightforward. All you need to do is set IP Address to Dynamic in the Properties of lan card.

#setup

Select Network Configuration from menu list Select Lan card and enter on OK Select Use DHCP and Enter on OK Now click on it and Quit to Come back on Root Prompt 

Now Restart the Network Service to Obtain IP from DHCP Server  

5) Window Client configuration

To Configure Windows System as DHCP Clients open Lan Card Properties and Select TCP/IP and Click on Properties and Set Obtain IP Address Automatically.

Page 31: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 31/94

 

Go on Command Prompt and Check new IP Address 

Check lease on DHCP server 

You can check allocated Address on Server.

Page 32: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 32/94

 

In Short:1.  Packages Required: dhcpd-5.16-5.i386.rpm 

2.  Services in DHCP: dhcpd 

3.  Procedure :

a)  First Give IP address to your System

IP Address=192.168.1.10

Subnet Mask = 255.255.255.0

DNS = 192.168.1.1

b)  Restart Your Network Service:

service network restart

c)  Now Install DHCP Package

yum install dhcp*

d)  Open Configuration File of this Server

vi /etc/dhcpd.conf 

e)  Write these lines in this configuration file:

Open Another file in this File:

: r /usr/share/doc/dhcp-3.0.5/dhcp.conf.sample

Now Save this File

f)  Now Again Open this File & Changes these Lines:

ddns-update-style interim;ignore client-updates;subnet 192.168.1.0 netmask 255.255.255.0 {

range 192.168.1.128 192.168.1.254;option subnet-mask 255.255.255.0;option broadcast-address 192.168.1.255;

option routers 192.168.1.1;option domain-name "your-domain.org";

option domain-name-servers 40.175.42.254, 40.175.42.253;

# Default DNS to be used by DHCP clientsoption netbios-name-servers 192.168.1.100; #

(Optional. Specify if used on your network)# DHCP requests are not forwarded. Applies when there is more than one ethernet device and

forwarding is configured.g)  Save this Configuartion File

h)  Now Restart your Network Service

service network restart

i)  Restart Your DHCP Service

service dhcpd restart

Page 33: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 33/94

 

IV)  SAMBA Server

Samba is a strong network service for file and print sharing that works on themajority of operating systems available today. When well implemented by the

administrator, it's faster and more secure than the native file sharing services available onMicrosoft Windows machines.

Samba is the protocol by which a lot of PC-related machines share files andprinters, and other information, such as lists of available files and printers. Operatingsystems that support this natively include Windows 95/98/NT, OS/2, and Linux, and addon packages that achieve the similar thing are available for DOS, Windows, VMS, Unix of all kinds, MVS, and more.

 Apple Macs and some Web Browsers can speak this protocol as well. Alternatives to SMB include Netware, NFS, AppleTalk, Banyan Vines, Decnet etc.

Many of these have advantages but none are public specifications and widelyimplemented in desktop machines by default. Samba software includes an SMB server, toprovide Windows NT and LAN Manager-style file and print services to SMB clients such asWindows 95, Warp Server, smbfs and others, a NetBIOS, rfc1001/1002  name server,which amongst other things gives browsing support, an ftp-like SMB client so that youcan access PC resources; disks and printers from Unix, Netware and other operatingsystems, and finally, a tar extension to the client for backing up PCs.

Most Linux systems are the part of networks that also run Windows systems.

Using Linux Samba servers, your Linux and Windows systems can share directories andprinters. This is most use full situation where your clients are window native and youwant to use the linux security features.

Page 34: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 34/94

 

1) Configure samba server

In this example we will configure a samba server and will transfer files fromclient side.For this example we are using two systems one linux server one window

clients.

a)  Per quest of Samba Server

   A linux server with ip address 192.168.0.254 and hostname Server    A window client with ip address 192.168.0.2 and hostname Client2   Updated /etc/hosts file on linux system   Running portmap and xinetd services   Firewall should be off on server 

We have configured all these steps in our pervious article.

b) Necessary Configuration for Samba Server

We suggest you to review that article before start configuration of samba server. Onceyou have completed the necessary steps follow this guide.

samba rpm is required to configure samba server.Check them if not found then install 

Now check smb, portmap, xinetd service in system service it should be on 

#setupSelect System service from list[*]portmap

[*]xinetd[*]smb

Now restart xinetd and portmap and smb service 

Page 35: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 35/94

 

To keep on these services after reboot on then via chkconfig command 

 After Reboot verify their status. It must be in running condition 

Create a Normal User named vinita 

Now Create /data Directory and Grant it full permission 

Open /etc/samba/smb.conf main samba Configuration Files 

By default name of Workgroup is MYGROUP in smb.conf file.You can change it with desire name 

Our Task is to share data folder for vinita User so go in the end of file and do editing 

Page 36: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 36/94

 

Save file with :wq and Exit 

Now add vinita user to Samba User 

We have made Necessary Change now on smb service and check it Status 

If you already have on this Service then Restart it with Service smb Restart Commands.

2) Client configuration for samba server

Go on windows system and ping samba server, change computer name to client2 and workgroup name to MYGROUP 

Page 37: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 37/94

 

Reboot system after changing workgroup name 

 After reboot open my network place here you can see samba server [ if not see then click on view workgroup computer in right pane, if still not see then use search button from tool bar and search computer samba server form ip ] 

First try to login from user vinita He will not successes as vinita have not  permission to login.

Now login from user vinita [ give the password which you set with smbpasswd command ] 

 As you can see in image user vinita gets the /data folder which we share from Samba Server .

Page 38: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 38/94

 

Copy some window Files in data Folder 

3) Check status on samba server

On Samba Server you can check runtime status of samba server to check it run 

smbstatus command 

In Output you see that one Samba Shared directory is used on window system 

Page 39: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 39/94

 

In Short:1. Packages Required: samba-3.0.3-5.i386.rpm 

2. Services in SAMBA: smb 

3. Procedure :

a)  First Give IP address to your System

IP Address=192.168.1.10Subnet Mask = 255.255.255.0

DNS = 192.168.1.1

b)  Restart Your Network Service:

service network restart

c)  Now Install SAMBA Package

yum install samba*

d)  Open Configuration File of this Server

vi /etc/samba/smb.conf 

e)  Write these lines in this configuration file:

[CHETAN]Comment=This is Samba ServerPath=/home/chetanPublic=yesWritable=yesPrintable=yesWritelist=helloReadlist=hello Valid users=chetan,helloBrowsable=yes

f)  Save this configuration Fileg)  Also Changes to Workgroup Name in this configuration File:

workgroup=WORKGROUP

interfaces=lo eth0 192.168.1.10/255.255.255.0hosts allow = 127. 192.168.1.

h)  Now add a user in your Systemadduser chetan

i)  Give Samba Password to this user

smbpasswd –a chetan j)  Now Restart the samba Service

service smb restartk)  Now open Samba Client

smbclient –L 192.168.1.10 –U chetanPasswd->chetanRetype->chetan

l)  Now open This UserSmbclient //192.168.1.10/chetan –U chetanSmb:\> ls

m) Go to Window XP systemn)  Share the C:\> Drive with share name <Window>o)  Now In Linux System Type the following Command:

Smbclient –L 192.168.1.13 –U hclSmbclient //192.168.1.10/Window –U hcl

Page 40: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 40/94

 

V)  SQUID Server

Proxy servers operate as an intermediary between a local network and Internet.Requests from local clients for web services can be handled by the proxy server. Squid isa high-performance HTTP and FTP caching proxy server. It is also known as a Web proxy

cache. As it stores data from frequently used Web pages and files, it can often give yourusers the data they need without their systems having to look to the Internet.

From squid web proxy server you can control what should be access on your network from internet. It could be act as a filter that could filter everything from porn site toadvertise , videos.

In our example we will configure squid web proxy server and filter sites and deny permission to specific host from accessing internet.

1) Configure squid web proxy server

Squid rpm is required to configure squid web proxy server check it for install if not found install it.

Check the Hostname and IP Address of server it will be use in editing of squid.conf 

Open /etc/squid/squid.conf for Editing 

Show Hidden line with :set nu option on vi command mode 

Page 41: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 41/94

 

You need to add three lines to the squid.conf file in the /etc/squid/ directory before activating Squid 

First editing is about hostname locate visible_hostname tag near about line no 

2835 

Go in the end of this tag near about line no and add the hostname which you have checked in pervious command 

By default squid works on port no 3128 but can change this.Port tag is located near line no 73 

For our example we using the default port.Next editing is to create access control list.

 Access control tag is located near the line no 2226 

We will create three access list.

  First to block host with ip address 192.168.1.7 from accessing internet.  Second to block a particular site.  Third to allow our lab network for accessing internet.

Page 42: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 42/94

 

Go in the end of access control tag near about line 2410 and create access list as show here 

Final editing is to implement whatever access list you have configured in access list tag go to http access tag near line no 2482 

In the end of this tag near line no 2529 apply the configured access list 

Be very careful about the order of access list alway put http_access deny allline in the end of all line. Whatever access list defined below the http_access deny all linewill never be checked.

You have made necessary changed in squid.conf now save it and return to command prompt.

We have created a access list web_deny to filter the web traffic. We have set http_accessdeny web_deny tag in squid.conf. Now you can add the url of those websites in this filewhich you want block.

Now create /etc/squid/web_deny file.

For testing purpose in our example we are blocking  www.google.com  

Page 43: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 43/94

 

You can add any sites url in this file which you want to block.You have completed all necessary steps now start the squid service.

2) Squid client configuration

On client set the IP Configuration. Set proxy servers ip 192.168.1.3 to default getway and dns server ip on client system.

Now open the web browser and set the port number and ip address of proxy server in connection tab 

Page 44: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 44/94

 

If you can Successful Retrieve website mean Squid is working correctly 

Now try to open  www.google.com  

Now go system which ip address is 192.168.1.7 and Try to access after doing 

same setting 

Page 45: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 45/94

 

VI)  DNS Server

 A DNS server, or name server, is used to resolve an IP address to a hostname or vice

versa. You can set up four different types of DNS servers:

   A master DNS server for your domain(s), which stores authoritative records for your domain.

   A slave DNS server, which relies on a master DNS server for data.   A caching-only DNS server, which stores recent requests like a proxy server. It 

otherwise refers to other DNS servers.   A forwarding-only DNS server, which refers all requests to other DNS servers.

Before configuring BIND to create a DNS server, you must understand some basic DNS concepts.

The entire hostname with its domain such as server.example.com  is called a fullyqualified domain name (FQDN). The right-most part of the FQDN such as .com or .net iscalled the top level domain, with the remaining parts of the FQDN, which are separatedby periods, being sub-domains.

These sub-domains are used to divide FQDNs into zones, with the DNS information foreach zone being maintained by at least one authoritative name server. 

The authoritative server that contains the master zone file, which can be modified toupdate DNS information about the zone, is called the  primary master server, or just master server. 

The additional name servers for the zone are called secondary servers  or slave servers. Secondary servers retrieve information about the zone through a zone transferfrom the master server or from another secondary server. DNS information about a zoneis never modified directly on the secondary server

1) Chroot Features

Chroot feature is run named as user named, and it also limit the files named cansee. When installed, named is fooled into thinking that the directory /var/named/chroot is actually the root or / directory.

Therefore, named files normally found in the /etc   directory are found in/var/named/chroot/etc directory instead, and those you would expect to find in/var/named are actually located in /var/named/chroot/var/named. 

The advantage of the Chroot feature is that if a hacker enters your system via a

BIND exploit, the hacker's access to the rest of your system is isolated to the files underthe chroot directory and nothing else. This type of security is also known as a Chroot jail.

Page 46: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 46/94

 

2) Configure DNS Server

In this example we will configure a DNS server and will test from client side.

For this example we are using three systems one Linux server one Linux clients and onewindow clients.

Bind and Caching-Nameserver rpm is required to configure DNS.Check them for install if not found install them.

Set Hostname to server.example.com and IP Address to 192.168.0.254 

Main configuration file for dns server is named.conf. By default this file is not created in /var/named/chroot/etc/ directory.

Instead of named.conf a sample file/var/named/chroot/etc/named.caching-nameserver.conf  is created. This file isuse to make a caching only name server. You can also do editing in this file afterchanging its name to named.conf to configure master dns server or you can manuallycreate a new named.conf file.

Page 47: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 47/94

 

In our example we are creating a new named.conf file 

We are using bind's chroot  features so all our necessary files will be located in chroot directory. Set directory location to  /var/named. Further we will set the location of forward zone and reverse lookup zone files. If you cannot create this file manually then download this file and copy to /var/named/chroot/etc/  

Save this file with :wq and Exit.

3) Configure zone file

We have defined two zone files example.com.zone for forward zone and

0.168.192.in-addr.arpa for reverse zone. These files will be store in/var/named/chroot/var/named/ location. We will use two sample files for creatingthese files.

Change directory to /var/named/chroot/var/named and Copy the sample files to name which we have set in named.conf 

Now open forward zone file example.com.zone 

By default this file will look like this 

Page 48: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 48/94

 

Change this file exactly as shown in image below 

If you feel difficulty to modify this file then download this configured file and copy to /var/named/chroot/var/named . Now open reverse lookup zone file 0.168.192.in-addr.arpa 

By default this file will look like this 

Change this file exactly as shown in image below 

If you feel difficulty to modify this file then download this configured file and copy to /var/named/chroot/var/named 

Now changed the ownership of these zone files to named group 

Page 49: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 49/94

 

Now start the Named Service 

If service restart without any error means you have successfully configured master name server in our next article we will learn how to configure salve dns server and test it.

Page 50: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 50/94

 

VII) MAIL Server

In a company environment, email is an essential component to the work day.Email is used to communicate with both internal employees and external customers. In

exam you will be tested to configure the send mail server for you local LAN.

By default sendmail server allows to connect to local host only. So we should editthe /etc/mail/sendmail.mc file to allow connect to other hosts.

The sendmail daemon is configured from a directory of files in /etc/mail and a directoryof configuration files in /usr/share/sendmail-cf . There are two basic configurationfiles:

  sendmail.cf The main sendmail configuration file.

  sendmail.mc  A macro that's easier to edit, which can be used to generate a new sendmail.cf file.

For this example we are using two systems one linux server one linux clients. These arethe pre quest for a sendmail server

   A linux server with ip address 192.168.0.254 and hostname Server    A linux client with ip address 192.168.0.1 and hostname Client1    A Configured DNS server on Linux server   Updated /etc/hosts file on both linux system   Running portmap and xinetd services   Firewall should be off on server 

We have configured all these steps in our pervious article.

1) Configure sendmail server

Sendmail and m4 rpm are required to configure Sendmail server check them for install if not found install them.

Mail server program reads the /etc/mail/sendmail.cf . To change theconfiguration on mail server, we should edit the /etc/mail/sendmail.mc file. WhenSendmail is started or restarted with the service sendmail restart command a newsendmail.cf file is automatically generated if sendmail.mc has been modified. In examyou should generate it with m4 command.

Page 51: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 51/94

 

Open /etc/mail/sendmail.mc for Editing 

Show Hidden line with :set nu option on vi command mode 

By default, the following line limits sendmail access to Connect local host only [line no 116] 

You can allow other computers to use your sendmail server by commenting out this line.

In the sendmail.mc file , lines that begin with dnl, which stands for delete tonew line, are considered comments. Some lines end with dnl, but lines ending in dnl arenot comments

Comment this line with dnl keyword followed by # sign 

Save this file with :wq and exit.Now generate new sendmail.cf file by using m4 command as shown here 

Now restart sendmail service and also set it on with chkconfig 

If Sendmail Service restart without any error means you have configuredsendmail successfully.

Page 52: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 52/94

 

2) Configure sendmail client side

We are using another linux system to test sendmail server. All configuration are sameas you have done on server system.

Check sendmail and m4 rpm for install. Open /etc/mail/sendmail.mc file and locate line no 116 and put a dnl with # sing and save file. All step are same which you have done on server.

Now generate new sendmail.cf file by using m4 command as shown here 

Now restart sendmail service and also set it on with chkconfig 

3) Testing of sendmail server

We will test sendmail server by sending and receiving mail in lab environment.For this we use two user one on each system.Now create one user on each system vinita on server 

 And nikita on client system 

Page 53: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 53/94

 

Now send mail from user vinita to nikita and from nikita to user vinita and also check each others mail by mail command 

Use full user name to send mail.For example to send mail to nikita use nikita@client1 and to send mail to vinita 

use  [email protected]  

Page 54: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 54/94

 

VIII)  TELNET Server

Telnet Server is used to login into another system. You can use the telnet command to log in remotely to another system on your network. The system can be onyour local area network or available through an Internet connection. Telnet operates as

if you were logging in to another system from a remote terminal. You will be asked for alogin name and password. In effect, you are logging in to another account on anothersystem. In fact, if you have an account on another system, you could use Telnet to log into it.

 You invoke the Telnet utility with the keyword telnet. If you know the name of the siteyou want to connect with, you can enter telnet and the name of the site on the Linuxcommand line.

CAUTION The original version of Telnet is noted for being very insecure. For 

secure connections over a network or the Internet, you should use the Secure Shell (SSH). We will cover SSH server in next article. SSH operate in the same way as the original but use authentication and encryption to secure the Telnet connection. Even so, it is advisable never to use Telnet to log in to your root account. That why by defaults root account is disable for root login. 

1) Configure telnet server

In this example we will configure a telnet server and will invoke connection from clientside.

For this example we are using three systems one linux server one linux clients and onewindow clients. To complete these per quest of telnet server Follow this link 

a)  Per Quest of Telnet Server

   A linux server with ip address 192.168.0.254 and hostname Server    A linux client with ip address 192.168.0.1 and hostname Client1    A windows xp system with ip address 192.168.0.2 and hostname Client2   Updated /etc/hosts file on both linux system   Running portmap and xinetd services   Firewall should be off on server 

b)  Necessary Configuration for Telnet Server

We suggest you to review that article before start configuration of telnet server. Once youhave completed the necessary steps follow this guide.

Four rpm are required to configure telnet server.telnet, telnet-server, portmap, xinetd check them if not found then install 

Page 55: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 55/94

 

Now check telnet, portmap, xinetd Service in System Service it should be on  

#setupSelect System service from list[*]portmap[*]xinetd[*]telnet

Now restart xinetd and portmap service 

To keep on these services after reboot on then via chkconfig command 

 After reboot verify their status.It must be in running condition 

Create a normal user named vinita 

2) On Linux client

Ping from Telnet Server and Run Telnet Command and Give user name and  password 

Page 56: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 56/94

 

3) On Window client

Ping from Telnet Server and Run Telnet Command 

Give user name and password 

4) Enable Root Login from Telnet Server

On Linux Server open File Security 

In the end of file add  pts/0 to enable one telnet session for root.

If you need to open more telnet session for root and add more pts/1 pts/2 and so on.

Now restart xinetd and portmap service 

Page 57: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 57/94

 

Verfiy from window by login from Root.

Page 58: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 58/94

 

(IX) SSH SERVER 

Telnet and FTP are well-known protocol but they send data in plain text format,

which can be captured by someone using another system on the same network, includingthe Internet.

On the other hand, all data transferred using OpenSSH tools is encrypted,making it inherently more secure. The OpenSSH suite of tools includes ssh for securelylogging in to a remote system and executing remote commands, scp for encrypting fileswhile transferring them to a remote system, and sftp for secure FTP transfers.

OpenSSH uses a server-client relationship. The system being connected to is referred toas the server. The system requesting the connection is referred to as the client. A 

system can be both an SSH server and a client. OpenSSH also has the added benefits of X11 forwarding and port forwarding.

 X11 forwarding, if enabled on both the server and client, allows users to display agraphical application from the system they are logged in to on the system they arelogged in from.

Port forwarding allows a connection request to be sent to one server but be forwardedto another server that actually accepts the request.

In this article we will discusses how to use OpenSSH, both from the server-side and theclient-side.

1) Configuring the ssh Server

The openssh-server RPM package is required to configure a Red Hat Enterprise Linux system as an OpenSSH server. If it is not already installed, install it with rpm commands as described in our pervious article. After it is installed, start the service as root with the command service sshd start . The system is now an SSH server and can accept connections. To configure the server to automatically start the service at boot time, execute the command chkconfig sshd on as root. To stop the server, execute the command service sshd stop.To verify that the server is running, use the command service sshd status.

2) Configure ssh server

In this example we will configure a ssh server and will invoke connection from client side.

For this example we are using two systems one linux server one linux clients . Tocomplete these per quest of ssh server Follow this link 

Page 59: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 59/94

 

a)  Per quest of ssh server

   A linux server with ip address 192.168.0.254 and hostname Server    A linux client with ip address 192.168.0.1 and hostname Client1   Updated /etc/hosts file on both linux system   Running portmap and xinetd services   Firewall should be off on server 

We have configured all these steps in our pervious article.

b)  Necessary configuration for ssh server

We suggest you to review that article before start configuration of ssh server. Once youhave completed the necessary steps follow this guide.

Three rpm are required to configure ssh server.Openssh-server, portmap, xinetd check them if not found then install 

Now check sshd, portmap, xinetd service in System Service it should be on  

#setupSelect System service from list[*]portmap[*]xinetd[*]sshd

Now restart xinetd and portmap and sshd Service.

Page 60: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 60/94

 

To keep on these services after reboot on then via chkconfig command 

 After reboot verify their status. It must be in running condition 

Create a normal user named vinita 

3) On Linux client

Ping from ssh server and run ssh command and give root password  

By default ssh command will enable root session. 

If you want to login from normal user then specify his name with -l options.

With ssh you can run any command on server without login (user password require) 

Page 61: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 61/94

 

X)  SYSLOG Server

 An important part of maintaining a secure system is keeping track of theactivities 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 unusualactivity. You can configure what syslogd records through the /etc/syslog.conf  configuration file.

The syslogd daemon manages all the logs on your system and coordinates with any of the logging operations of other systems on your network. Configuration information for syslogd is held in the /etc/syslog.conf file, which contains the names and locations foryour system log files.

By Default system accept the logs only generated from local host. In this example we will

configure a log server and will accept logs from client side.

For this example we are using two systems one linux server one linux clients . Tocomplete these per quest of log server Follow this link 

a)  Per quest of log server

   A linux server with ip address 192.168.0.254 and hostname Server    A linux client with ip address 192.168.0.1 and hostname Client1   Updated /etc/hosts file on both linux system   Running portmap and xinetd services   Firewall should be off on server 

We have configured all these steps in our pervious article.

b)  Necessary Configuration for log server

We suggest you to review that article before start configuration of log server. Once youhave completed the necessary steps follow this guide.

Check syslog, portmap, xinetd service in system service it should be on  

#setupSelect System service from list[*]portmap[*]xinetd[*]syslog

Now restart xinetd and portmap Service.

Page 62: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 62/94

 

To keep on these services after reboot on then via chkconfig command 

 After reboot verify their status.It must be in running condition 

Now open the /etc/sysconfig/syslog file 

 And locate SYSLOGD_OPTIONS tag 

add -r option in this tag to accepts logs from clients 

-m 0 disables 'MARK' messages.-r enables logging from remote machines-x disables DNS lookups on messages recieved with –r

 After saving file restart service with service syslog restart command 

1) On Linux client

Ping from log server and open /etc/syslog.conf file 

Page 63: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 63/94

 

Now go to the end of file and do entry for serve as user.* @ [ server IP] as shown 

 After saving file restart service with service syslog restart command 

Now restart the client so it can send log entry to server.( Note that these logs will generate when client boot, so do it restart not shutdown) 

2) Check clients log on Log server

To check the message of client on server open

In the end of this file you can check the log from clients 

Page 64: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 64/94

 

(XI) NIS Server

NIS, or Network Information Systems, is a network service that allows

authentication and login information to be stored on a centrally located server. Thisincludes the username and password database for login authentication, database of usergroups, and the locations of home directories.

1) Configure NIS server

In this example we will configure a NIS server and a user nis1 will login from client side.

For this example we are using two systems one linux server one linux clients . Tocomplete these per quest of ssh server Follow this link 

a)  Per quest of nis server

   A linux server with ip address 192.168.0.254 and hostname Server    A linux client with ip address 192.168.0.1 and hostname Client1   Updated /etc/hosts file on both linux system   Running portmap and xinetd services   Firewall should be off on server 

b)  Necessary configuration for nis server

Seven rpm are required to configure nis server.ypserv, cach, nfs, make, ypbind, portmap, xinetd check them if not found then install 

Page 65: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 65/94

 

Now check nfs,ypserv,yppasswdd,ypbind, portmap, xinetd service in system service it should be on  

#setupSelect System service from list

[*]portmap[*]xinetd[*]nfs[*]ypserv[*]yppasswdd[*]ypbind

Now open /etc/sysconfig/network file 

Set hostname and NIS domain name as shown here and save file 

Now create a user named nis1 and give his home directory on /rhome with full  permission 

Now open /etc/exports file 

Share /rhome/nis1 directory for network 

Save this with :wq and exit Now open /var/yp/Makefile file 

 And locate line number 109 [ use ESC + : +set nu command to show hidden lines or read our vi editor article to know more about vi command line option ] 

Page 66: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 66/94

 

Now remove other entry from this line excepts passwd group hosts netid 

save this with :wq and exit 

Now restart these service  

#service portmap restart#service xinetd restart

#service nfs restart#service ypserv restart#service yppasswdd restart

Don't restart ypbind service at this time as we haven't updated our database 

Now change directory to /var/yp and run make command to create database 

Now update this database by running this commands .

[first add server and then add all client machine one by one. After adding press CTRL+D to save, confirm by pressing y] 

Page 67: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 67/94

 

Now once again restart all these service this time there should be no error 

#service portmap restart#service xinetd restart#service nfs restart#service ypserv restart#service yppasswdd restart

#service ypbind restart

Now set all these service to on with chkconfig so these could be on after restart 

#chkconfig portmap on#chkconfig xinetd on#chkconfig nfs on#chkconfig ypserv on#chkconfig yppasswdd on#chkconfig ypbind on

2) Client configuration

Before you start client configuration we suggest you to check proper connectivity between server and client.

First try to login on NIS server from telnet. If you can successfully login via telnet then try to mount /rhome/nis1 directory via nfs server.

If you get any error in telnet or nfs then remove those error first. You can read our pervious article for configuration related help. 

Once you successfully completed necessary test then start configuration of client sides.

Two rpm are required to configure clients yp-tools and ypbind check them for install 

Now open /etc/sysconfig/network File 

 And make change as shown here 

Now run setup command and select authentication configuration from list 

#setup

Page 68: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 68/94

 

Now check mark on NIS and Enter on Next 

Set domain name to RHCEand server to 192.168.0.254 and click on OK 

No error should be occurred here if you see any error then Check all Configuration.No open /etc/auto.master file 

In the end of file do editing of /rhome as Shown here 

Page 69: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 69/94

 

Save the file with :wq and Exit Now open /etc/auto.misc file 

In the end of file do editing of user nis1 as shown here 

Save the file with :wq and exit Now restart autofs and ypbind service 

Set these Service on via chkconfig Commands 

#chkconfig autofs on#chkconfig ypbind on

Now Restart the System 

#reboot  –f 

Login from nis1 user on client system 

Page 70: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 70/94

 

XII) WEB Server

When you view a web page over the Internet, the code to create that pagemust be retrieved from a server somewhere on the Internet. The server that sends your

web browser the code to display a web page is called a web server. There are countlessweb servers all over the Internet serving countless websites to people all over the world.Whether you need a web server to host a website on the Internet a Red Hat EnterpriseLinux server can function as a web server using the  Apache HTTP server. The ApacheHTTP server is a popular, open source server application that runs on many UNIX-basedsystems as well as Microsoft Windows.

1) Configure web server

In this example we will configure a web server. 

Necessary rpm for web server is  httpd, httpd-devel and apr check them for Install 

Now configure the IP Address to 192.168.0.254 and check it 

Start httpd daemons and verify its running Status 

Page 71: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 71/94

 

2) Configure virtual hosting

In this example we will host a website www.vinita.com to apache web server.create a documents root directory for this website and a index page 

For testing purpose we are writing site name in its index page 

Save file and exit Now open /etc/hosts file 

In the end of file bind system IP with  www.vinita.com  

Now open  /etc/httpd/conf/httpd.conf main configuration file of Apache Server .

Page 72: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 72/94

 

Locate Virtual Host Tag 

Remove # from the beginning and add the IP of host 

Now go in the end of file and copy last seven line [ virtual host tag ] and paste them in the end of file.Change these seven lines as shown in image 

Now save this file and exit from it You have done necessary configuration now restart the httpd service 

and test this configuration run links command 

If links command retrieve your home page 

Means you have successfully configured the virtual host now test it with site name 

Page 73: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 73/94

 

In output of links command you should see the index page of site 

3) Configure multiple site with same ip address

 At this point you have configured one site www.vinita.com with the ip address192.168.0.254. Now we will configure one more site www.nikita.com with same ipaddress

Create a documents root directory for  www.nikita.com website and a index  page 

For testing purpose we are writing site name in its index page 

Save file and exit Now open /etc/hosts file and bind system ip with  www.nikita.com  

Now open /etc/httpd/conf/httpd.conf main configuration file of Apache Server 

Now go in the end of file and copy last seven line [ virtual host tag ] and paste them in the end of file. change these seven lines as shown in image 

Page 74: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 74/94

 

Now save this file and exit from it You have done necessary configuration now restart the httpd service 

Test this configuration run links command 

4) Configure multiple site with multiple ip address

Now we will host multiple sites with multiple ip address. Create a virtual lan card on

server and assign its an ip address of 192.168.0.253. 

We will create a testing site www.nidhi.com  and will bind it with ip address of 192.168.0.253 

Create a documents root directory for www.nidhi.com website and a index  page 

For testing purpose we are writing site name in its index page 

Save File and Exit 

Now open /etc/hosts file and bind system ip with  www.nidhi.com  

Now open /etc/httpd/conf/httpd.conf main configuration file of apache server 

Page 75: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 75/94

 

Now go in the end of file and copy last seven line [ virtual host tag ] and paste them in the end of file.Change these seven lines as shown in image 

Now save this file and exit from it You have done necessary configuration now restart the httpd service 

Test this configuration run links command 

In output of links command you should see the index page of site 

5) How to create site alias

Now I will show you that how can you use site alias to configure more name of samesite. we configure a site www.vinita.com  in stating of example. now we will createwww.goswami.com site alias for this site so this site can be access with both name.

To create alias first make its entry in /etc/hosts file as shown here 

Page 76: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 76/94

 

Now open main apache configuration /etc/httpd/conf/httpd.conf 

Now go in the end of file and copy last seven line [ virtual host tag ] and paste them in the end of file. change these seven lines as shown in image 

Now save this file and exit from it You have done necessary configuration now restart the httpd service and test this configuration run links command 

In output of links command you should see the index page of site 

Page 77: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 77/94

 

XIII)   VNC Server

 VNC server is a used to share desktop with remote computer. VNC works on clientserver architecture. To share desktop you need vnc-server package and to access from

other computers you need vnc-viewer. In this tutorials I will show you how to configurevnc server.

1) To configure VNC- Server

Boot system in init 5 or graphic mode.Vnc-server rpm is required to configure server check it if not found install it.

Now click on preferences from system and select Remote Desktop 

This will launch a new window where you can set sharing and security for 

remote desktop 

Page 78: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 78/94

 

 Allow other users to view your desktop check this option if you to present your desktop on other computer 

 Allow other users to control your desktop Check this options if you want to grant permission to control user desktop to other user 

In security tab you can set password for the user who want to connect with server 

[Recommended] 

2) Configure Linux client

Go on client system and ping server.vnc-viewer rpm is required to configure clients .

Check it and if not found install . Now select accessories from application menu and click on vnc viewer

Page 79: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 79/94

 

This will launch a window Give vnc Server IP it and click on ok.

Once connected it will ask for password Give the password which you set on server 

On server side it will show a pop up and ask for permission click on allow 

 After getting permission from server side you can use server desktop on client 

side 

Page 80: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 80/94

 

Page 81: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 81/94

 

XIV)  PRINTER Server

Linux uses the Common UNIX Printing System, also known as CUPS. CUPS uses the Internet Printing Protocol (IPP) to allow local printing and print sharing. The/etc/cups/ directory stores all the configuration files for printing. However, these files

can be easily managed with the Printer Configuration Tool in Linux.

Before you can use any printer, you first have to install it on a Linux system on your network. To start the Printer Configuration Tool, go to the System menu on the top panel and select Administration, Printing or execute the command system-config-printer.

If no printers are available for the system, only the Server Settings view is available for selection. If local printers are configured, a Local Printers menu will available.

1) Install new printer

Click New Printer on the toolbar.

In the dialog window that appears, accept the default queue name or change it to a short, descriptive name that begins with a letter and does not contain spaces. Then select printer from list and click on forward and click on finsh.

spool directories

Page 82: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 82/94

 

When your system prints a file, it makes use of special directories called spool directories. The location of the spool directory is obtained from the printer's entry in its configuration file. On Linux, the spool directory is located at /var/spool/cups under a directory with the name of the printer.

print job

 A print job is a file to be printed. When you send a file to a printer, a copy of it is made and placed in a spool directory set up for that printer.

Classes

CUPS features a way to let you select a group of printers to print a job instead of selecting just one. That way, if one printer is busy or down, another 

 printer can be automatically selected to perform the job. Such groupings of  printers are called classes. Once you have installed your printers, you can 

group them into different classes.

Once you have successfully installed local printer it will show in right pane.and in left pane you can see all administrative options.

  To view shared printer on other system Tick mark on first option   To share locally attached printer tick mark on second option   To allow remote administration of this printer check mark on third option 

Tick mark on appropriate option and click on apply 

Page 83: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 83/94

 

2) Configure window clients

Go on window system and ping from printer server and open internet explorer and give the ip address of server with printer port 631 

This will launch CUPS web application click on manage printer 

Now you will see the shared printer on server click on print test page 

Page 84: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 84/94

 

 A test page will be send on printer server copy this url of printer 

Click on start button select printer and fax and click on add new printer. this will launch add new printer wizard click next on welcome screen and select 

network printer 

On this screen select internet printer and paste the url which you copied from internet explorer 

Install appropriate driver from list or use have disk option you have drive cd and click next. On next screen set this printer defaults and click on next and finish.

Page 85: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 85/94

 

3) Remote administration of print server

Go on linux system and ping from server and click on printing from administration menu 

Now click on go to server 

Page 86: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 86/94

 

Now give print server ip address 

It will take few minute to connect from server depending on network speed 

Now give root password to connect printer server 

You can see all print administrative Manu in right pane Once you have connected with sever 

Page 87: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 87/94

 

4) Configure Linux clients

Go on linux system and ping from server and click on printing from administration menu 

Now click on new printer  

Click on forward In the next New Printer screen, select the type of connection to internet printing protocols and in hostname give server ip and printer name in printer name 

Select the appropriate model. If multiple drivers are available, select the one most appropriate for your configuration. If you do not want to choose the 

default and click forward and finish. The main Printer Configuration window should now include the name of your printer.

Page 88: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 88/94

 

To print test page click on print test page and a test page will send to print server 

5) Managing Printers from the Command-Line

The lpadmin command enables you to perform most printer administration tasks from the command-line.

Page 89: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 89/94

 

lpc  To view all known queueslpr  To send print requests to any local print queuelpq  To see the print queuelprm  To delete the jobs of your choice use it with the job numberlp  To print any file.

Page 90: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 90/94

 

XV)  YUM Server

 YUM stands for Yellow dog Updater  , Modified because it is based on YUP,the  Yellow dog Updater. Yellow Dog is a version of Linux for the Power Architecturehardware. YUP, and later YUM, were written by the Linux community as a way to

maintain an RPM-based system.

 Advantages of YUM

 Automatic resolution of software dependencies. If a package installation orupgrade request is made and requires the installation or upgrade of additional packages, YUM can list these dependencies and prompt the user to install or upgrade them.

Command-line and graphical versions. The command-line version can be run on asystem with a minimal number of software packages. The graphical versions offer ease-

of-use and a user-friendly graphical interface to software management.

Multiple software locations at one time. YUM can be configured to look for softwarepackages in more than one location at a time.

 Ability to specify particular software versions or architectures. Software locationsaccessible by YUM can contain multiple versions of the same RPM package and differentbuilds for different architectures such as one for i686 and one for x86_64. yum can easilycheck the appropriate version and download it.

While it's unlikely that you'll have an Internet connection during the exam, you could have a 

network connection to a local repository. So you should be ready to use the yum command during the Red Hat exam. 

1) Create dump of RHEL CD

Whether you perform network installation or create yum repository file you need dump of RHEL CD. It is generally created on server in RHCE exam. Candidate is given a location of this dump to perform network installation.

We will create dump of RHEL CD on /var/ftp/pub and use this for network installation or

to create yum repository files.

Check how many space is available on  /var partition mimimun 4 GB space is required 

Now mount RHEL dvd on mnt and copy entire disk on /var/ftp/pub 

Page 91: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 91/94

 

Dump is created on /var/ftp/pub now you can umount RHEL dvd 

2) Configure yum server

a)  Pre quest of yum server

we assume that you have completed these pre quest of yum server

   A Linux system with hostname  Server.example.com  and with ip address of 192.168.0.254  

  Dump of RHEL disk on /var/ftp/pub location 

Once you have completed these pre quests follow this guide.

Change directory to /var/ftp/pub/Server 

Yum and Createrepo rpm are required for Yum server install them 

Now install createrepo rpm 

 After installing necessary package change directory to /var/ftp/pub 

Page 92: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 92/94

 

Now create repository of Server directory 

Repository of all rpm will be created in few minute 

Now create repository for VT 

In few second all necessary repository will be created for VT 

Now create errata directory and repository for it 

Page 93: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 93/94

 

During the process of creating repository two hidden directory with named .olddata is created automatically remove them 

Now check hostname and change directory to /etc/yum.repos.d. copy sample repository file to the file with hostname and open it 

Default repository file look like these 

Remove defaults line and set new location of Sever and VT as shown here 

Save file with :wq and Exit Now remove all temporary data file with yum clean all command 

Page 94: Seculabs eBook - Complete Linus Servers - Installation and Configuration

7/29/2019 Seculabs eBook - Complete Linus Servers - Installation and Configuration

http://slidepdf.com/reader/full/seculabs-ebook-complete-linus-servers-installation-and-configuration 94/94

 

To test yum server remove telnet package, after checking all dependences it will ask for conformation press y 

Now install telnet package from yum server 

 After checking all dependences it will ask for conformation press y 


Recommended