Tanti Technology

My photo
Bangalore, karnataka, India
Multi-platform UNIX systems consultant and administrator in mutualized and virtualized environments I have 4.5+ years experience in AIX system Administration field. This site will be helpful for system administrator in their day to day activities.Your comments on posts are welcome.This blog is all about IBM AIX Unix flavour. This blog will be used by System admins who will be using AIX in their work life. It can also be used for those newbies who want to get certifications in AIX Administration. This blog will be updated frequently to help the system admins and other new learners. DISCLAIMER: Please note that blog owner takes no responsibility of any kind for any type of data loss or damage by trying any of the command/method mentioned in this blog. You may use the commands/method/scripts on your own responsibility. If you find something useful, a comment would be appreciated to let other viewers also know that the solution/method work(ed) for you.

Monday 28 August 2017

Basics Part1


1) What is Linux?

Linux is an operating system based on UNIX, and was first introduced by Linus Torvalds. It is based on the Linux Kernel, and can run on different hardware platforms manufactured by Intel, MIPS, HP, IBM, SPARC and Motorola. Another popular element in Linux is its mascot, a penguin figure named Tux.


2
) What is the difference between UNIX and LINUX?

Unix originally began as a propriety operating system from Bell Laboratories, which later on spawned into different commercial versions. On the other hand, Linux is free, open source and intended as a non-propriety operating system for the masses.


3) What is BASH?

BASH is short for Bourne Again SHell. It was written by Steve Bourne as a replacement to the original Bourne Shell (represented by /bin/sh). It combines all the features from the original version of Bourne Shell, plus additional functions to make it easier and more convenient to use. It has since been adapted as the default shell for most systems running Linux.


4) What is Linux Kernel?

The Linux Kernel is a low-level systems software whose main role is to manage hardware resources for the user. It is also used to provide an interface for user-level interaction.


5) What is LILO?

LILO is a boot loader for Linux. It is used mainly to load the Linux operating system into main memory so that it can begin its operations.


6) What is a swap space?

A swap space is a certain amount of space used by Linux to temporarily hold some programs that are running concurrently. This happens when RAM does not have enough memory to hold all programs that are executing.


7) What is the advantage of open source?

Open source allows you to distribute your software, including source codes freely to anyone who is interested. People would then be able to add features and even debug and correct errors that are in the source code. They can even make it run better, and then redistribute these enhanced source code freely again. This eventually benefits everyone in the community.


8 ) What are the basic components of Linux?

Just like any other typical operating system, Linux has all of these components: kernel, shells and GUIs, system utilities, and application program. What makes Linux advantageous over other operating system is that every aspect comes with additional features and all codes for these are downloadable for free.


9) Does it help for a Linux system to have multiple desktop environments installed?

In general, one desktop environment, like KDE or Gnome, is good enough to operate without issues. It’s all a matter of preference for the user, although the system allows switching from one environment to another. Some programs will work on one environment and not work on the other, so it could also be considered a factor in selecting which environment to use.


10) What is the basic difference between BASH and DOS?

The key differences between the BASH and DOS console lies in 3 areas:


- BASH commands are case sensitive while DOS commands are not;

- under BASH, / character is a directory separator and \ acts as an escape character. Under DOS, / serves as a command argument delimiter and \ is the directory separator
- DOS follows a convention in naming files, which is 8 character file name followed by a dot and 3 character for the extension. BASH follows no such convention.

11) What is the importance of the GNU project?

This so-called Free software movement allows several advantages, such as the freedom to run programs for any purpose and freedom to study and modify a program to your needs. It also allows you to redistribute copies of a software to other people, as well as freedom to improve software and have it released to the public.


12) Describe the root account.

The root account is like a systems administrator account, and allows you full control of the system. Here you can create and maintain user accounts, assigning different permissions for each account. It is the default account every time you install Linux.


13) What is CLI?

CLI is short for Command Line Interface. This interface allows user to type declarative commands to instruct the computer to perform operations. CLI offers an advantage in that there is greater flexibility. However, other users who are already accustom with using GUI find it difficult to remember commands including attributes that come with it.


14) What is GUI?

GUI, or Graphical User Interface, makes use of images and icons that users click and manipulate as a way of communicating with the computer. Instead of having to remember and type commands, the use of graphical elements makes it easier to interact with the system, as well as adding more attraction through images, icons and colors.


15) How do you open a command prompt when issuing a command?

To open the default shell (which is where the command prompt can be found), press Ctrl-Alt-F1. This will provide a command line interface (CLI) from which you can run commands as needed.


16) How can you find out how much memory Linux is using?

From a command shell, use the “concatenate” command: cat /proc/meminfo for memory usage information. You should see a line starting something like: Mem: 64655360, etc. This is the total memory Linux thinks it has available to use.


17) What is typical size for a swap partition under a Linux system?

The preferred size for a swap partition is twice the amount of physical memory available on the system. If this is not possible, then the minimum size should be the same as the amount of memory installed.


18) What are symbolic links?

Symbolic links act similarly to shortcuts in Windows. Such links point to programs, files or directories. It also allows you instant access to it without having to go directly to the entire pathname.


19) Does the Ctrl+Alt+Del key combination work on Linux?

Yes, it does. Just like Windows, you can use this key combination to perform a system restart. One difference is that you won’t be getting any confirmation message and therefore, reboot is immediate.


20) How do you refer to the parallel port where devices such as printers are connected?

 Whereas under Windows you refer to the parallel port as the LPT port, under Linux you refer to it as /dev/lp . LPT1, LPT2 and LPT3 would therefore be referred to as /dev/lp0, /dev/lp1, or /dev/lp2 under Linux.



MAIL Server Configuration on RHEL / CentOS




MAIL SERVER

 Sendmail
 Postfix
 Qmail:

 The Qmail MTA is another alternative to sendmail.
 It is used by an impressive list of Internet sites.
Smail:
It is reportedly easier to configure than sendmail.
It also includes support for blocking messages.
Exim:
The Exim MTA was developed at Cambridge (U.K.) and is licensed under the GPL. While based on an older MTAknown as Smail
    
 

       
 Features of mail server:

we can forward mails from one domain to another domain.with the help of this mail server we can forward mails to branches or public
mailserver must have public ip

we have three types of mail servers
1)MUA
2)MTA
3)MDA

 
 


    sending & recieving mails using TCP/IP protocols such as
 
SMTP server (simple mail transfer protocol port no.25)
pop3 server (postoffice protocol port no.110)
nmtp server (network news transfer protocol port no.119)
imap server (internet message access protocol port no.143)
x.500 server (directory server)
ldap server (leightweight directory access protocol)
x.400 server (message handling system)


Functions of mail server:
Sending and receiving mail from one user to group of users over internet
 
Sending and receiving mail from one mail server to different mail servers over internet
 
Sending and receiving mail that contains voice, images, sounds, movies
(Note:MIME is the service which is used to share voice, images, sounds, movies over internet. MIME-multipurpose mail extension)

Different mail servers:

Exchange server            Microsoft
Send mail            Linux/unix
Qmail                Linux/unix
Postfix                Linux/unix
Squirell mail            Linux/unix
Lotus domino            IBM(we can use on any operating system)
Lotus notes(client)        IBM
Novel groupwise            Novel

MUA:(mail user agent)
this is a client side package used to retrive mails from mail server
ex:mail(text),mutt,evolution,kmail

MTA(mail transfer agent)
this is the server side service used to send and receive mails with in the domain
ex:sendmail(text&gui),postfix,qmail

MDA:(mail delivery agent)
this is the server side service used to send and receive mails from one mailserver to another mail server.
ex:dovecot,procmail


Send mail:
    It listens mails sent by MUA's through port no.25.
 
in this mail server mails will be strictly check for exploids and regenerate the packet and send to MDA.

we have two types in MDA:
1)pop3
2)IMAP

1)pop3:(postoffice protocol 3 port no.110)
mails are in /var/spool/mail
    The pop3 connect to server with port no.110 and downloads /var/spool/mail/U1 and the clients every mail and move it to the client p.c(don't have backup)
    The entire mails of user(U1) are downloaded into client system. It any damage had done to the client system. I want to get back.
2)IMAP:
From the client it connects to port no.143 and get the mails of the user(one copy) and it doesn't remove original file when ever the damage occurs in client p.c. We can download another copy from server.

pop3--> moves original mails to the client
IMAP--> It send only one copy of the mails to the client


steps to configure mailserver
(here we are configuring MTA & MDA in one system)

#yum install sendmail-* -y
#service sendmail start
#chkconfig sendmail on
#cd /etc/mail
#vi sendmail.mc
add dnl # for line no116
 
ex:DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
save&quit

[root@server1 mail]# m4 sendmail.mc > sendmail.cf
# service sendmail restart

(to configure MDA)
#yum install dovecot-* -y
#service dovecot start
#chkconfig dovecot on
#vi /etc/dovecot.conf
(line no17)  #protocols = imap imaps pop3 pop3s(remove #)
save &quit


to check:

add 2users login as one user & send mail to another user
then login as second user type mail

2nd method

as root:  mutt -f {mahesh@server1.redhat.com}
yes
provide mahesh  password
O




configuruing e-mail aliases:

if u want to send an users mails to another user we have to configure email alias
steps

#vi /etc/aliases
go to last line add as follows
mahesh:   john  (here in this example we are redirecting mahesh mails to john)
save&quit
#newaliases (to update /etc/aliases file)


tocheck :
send a mail to sam from remote system
 
you have to get mail in john mailbox


###################################


NIS Configuration in Linux (Redhat or CentOS 6)



                                    NIS (Network Information Server)

The two common authentication servicesare the Network Information Service (NIS)
and the Lightweight directory Access Protocol (LDAP).


Both NIS and LDAP allows to manage all users &computer centrally.
it works with the help of sunrpc
here passwords are in clear text format. we normally use nfs along wuth nis to share users home directories from server to client for security purpose

steps to configure nis
#yum install yp* -y
#service ypserv start
#chkconfig ypserv on
#service ypbind start
#service ypxfrd start
#service yppasswdd start
#vi /var/yp/Makefile
(change as follows)
all:  passwd group hosts rpc services netid protocols mail \
 change as follows
all:  passwd group hosts
# rpc services netid protocols mail \
save&quit
#/usr/lib/yp/ypinit -m (to make as master nis server)
ctrl+d
 
y (to create database)
#useradd user1
#useradd user2
#cd /var/yp
#make (to update database)

to set nisdomain name:
#nisdomainname RHCE
#vi /etc/sysconfig/network
add a new line
NISDOMAINNAME=RHCE
save&quit
#service network restart
#service ypxfrd restart
#service ypbind restart
#service yppasswdd restart
#service ypserv restart


(sharing home directories via nfs)
#yum install nfs-* -y
#service portmap start
#service portmap restart
#service nfs start
#chkconfig portmap on
#chkconfig nfs on
#vi /etc/exports
/home/u1    *.redhat.com(rw,sync)
save&quit
#service nfs restart
#exportfs -v
#exportfs -r





client side configuration:

#yum install yp-bind-* -y
#service ypbind start
#chkconfig ypbind on
#setup
select Authentication
select nis
provide nis domainname&nis server ip
#setsebool -P allow_ypbind 1
#vi /etc/auto.master
add a new line
/home    /etc/auto.misc
save7quit
u1  -rw,soft,intr     server1.redhat.com:/home/u1
save&quit
#service autofs restart
#getent passwd u1
# su - u1

DHCP Configuration in Linux (Redhat or Centos 6)



                         DHCP(Dynamically Host Configuration Protocol)

  dhcp provide a method for hosts on a network to request and be granted,configuration information including the address of routers and nameservers
      Ipv4 addresses are either dynamically assigned from a range of address and netmask,its default gateway  .Domain name and dns server,timeserver,and location of kickstart conf.files

service profile:

type :SysteV-managed service
package:dhcp
Daemon: /usr/sbin/dhcpd
script : /etc/init.d/dhcpd
ports : 67(bootps), 68 (bootpc)
conf.file: /etc/dhcpd.conf,/var/lib/dhcpd/dhcpd.leases
related: dhclient,dhcpv6-client,dhcpv6


steps to configure dhcp server:

#yum install dhcpd-* -y
#service dhcpd start
#chkconfig dhcpd on
#cp /usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample /etc/dhcpd.conf
# vi /etc/dhcpd.conf
(change as follows)

ddns-update-style interim;
ignore client-updates;

subnet 192.168.0.0 netmask 255.255.255.0 {

# --- default gateway
        option routers                  192.168.0.254; (server ip)
        option subnet-mask              255.255.255.0;  (subnetmask)

        option nis-domain               "domain.org";
        option domain-name              "redhat.com";   (domain name)
        option domain-name-servers      192.168.0.254;   (dns ip)

        option time-offset              -18000; # Eastern Standard Time
#       option ntp-servers              192.168.1.1;
#       option netbios-name-servers     192.168.1.1;
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
#       option netbios-node-type 2;

        range dynamic-bootp 192.168.0.1 192.168.0.20; (ip range)
        default-lease-time 21600;
        max-lease-time 43200;

save & quit
#service dhcpd restart
if you want to give a specific ip for a system

at the end of the file specify as follows

host station1
            { hardware ethernet 00:a0:cc:3d:45:3e
 
              fixed address 192.168.0.10;
             }
}
         (here in this example we are providing 192.168.0.10 for a specific system we have to type mac address of that system at hardware ethernet)


APACHE Web Server Configuration on Linux RHEL / CentOS 5&6


                       APACHE Web Server Configuration
                        
                                  


 Different web servers in world :-

Tux               :     Kernel based only text support, Very fast
Stronghold   :     from RedHat Linux
Sun one        :    Also known as iPlanet from Sun Microsystems
AOL server    :    American online free web server
Apache          :    Open source




what is apache?

Apache is a freeware & is the Most Popular& widely used Web Server which consumes 60% of web market that can be configured in both windows and LINUX.
 

Apache Server is used to launch  our web pages  as websites.

service profile:  
·                     Type         :    System V-managed service 
·                     packages  :    httpd,httpd-devel,httpd-manual 
·                     Daemon    :    /usr/sbin/httpd
·                     script        :    /etc/init.d/httpd
·                     ports         :    80(http), 443(https) 
·                     configuration file  :  /etc/httpd/conf/httpd.conf

steps to configure apache :
 

   #yum install httpd-*  -y
   #service httpd start
   #chkconfig httpd on
   #vi /etc/httpd/conf/httpd.conf
 

copy 7 lines (line no 1003 to 1009)
paste under 1009 line
change as follows

         ServerAdmin root@www.bsrtech.net

         DocumentRoot /var/www/html/bsrtech/
         ServerName  www.bsrtech.net

        DirectoryIndex index.html
 


(here 192.168.0.22 is our system's ip & /var/www/html/bsrtech is the document root here we have to place web pages to convert as web site, NOTE: web page must be with a name of index.html)
:save&quit

cd /var/www/html/

create directory name with bsrtech
 # mkdir bsrtech

 # cd bsrtech
 
 #vim index.html
(type as follows)
  
 
      
           
                  

"    welcome to BSR TECHNOLOGIES"


          


      

 
:save & quit
#service httpd restart
open firefox and type in url
http://www.bsrtech.net (now the website will appear)
 

To launch virtual websites using virtual hostnames

#vi /etc/httpd/conf/http.conf
(line no 990) # NameVitualHost *: 80 (remove # and *:80) type ur system ip
(NameVirtualHost 192.168.0.22:80 )
copy last five lines and paste under it

 NameVirtualHost 192.168.0.22:80
  
      ServerAdmin root@www17.redhat.com
      DocumentRoot /var/www/virtual
      serverName  www17.redhat.com
  


(here we are changing system name as www17.redhat.com and document root under /var/www/virtual)
save & quit
#mkdir -p /var/www/virtual
# cd /var/www/virtual
 
# vi index.html


"welcome to virtual website"




save & quit
#service httpd restart


to check
 
open mozilla
 
type http://www17.redhat.com

 to create virtual webpages under any directory

by default selinux allows webpages which are located under /var/www/  if we want to launch a webpage which is not present under /var/www we have to change selinux context,boolean values.

ex:
# vi /etc/httpd/conf/httpd.conf

     ServerAdmin root@xxx17.redhat.com
     DocumentRoot /cyber
     serverName  xxx17.redhat.com
 

save&quit
#mkdir /cyber
#cd /cyber
#vi index.html


"welcome to cyber'+'technologies"




save & quit
#chcon -R --reference=/var/www/html /cyber
#service httpd restart

to check :
open mozilla
type in url box as follows
http://xxx17.redhat.com(u will get website)


(Click On below image to large......) 
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipVWEZ_OJhlq7n_jV0qZTadG7Ptv0FNkqpKfz4BsgpWUft5KRWE7YffepHMosCbzrbamvHqg7nef1V4L_BnPdlYqn3lNLn1TCExzyErv8YmbI-RGshIRrqSyjLik2K76t2sVCbmW4B6Q3F/s400/Client+Server+Architecture.bmp


##############################################################################


      
  TRY   THINGS   AFTER    PRACTICING EXAM ESSENTIALS


to create link pages in a website

#vi /etc/httpd/httpd.conf

    ServerAdmin root@www17.redhat.com
    DocumentRoot /var/www/virtual
    serverName  www17.redhat.com
    Alias /training   /var/www/training (add this line in that website)
 


save & quit
# cd /var/www/
#cat > training
(type any thing)
save
#service httpd restart


to check  :
go to mozilla
 type www17.redhat.com/training




to create Authenticated websites
#vi /etc/httpd/conf/httpd.conf

 
 AllowOverride AuthConfig
 

save & quit

# cd /var/www/html
#vi .htaccess
AuthName "it"
AuthType Basic
AuthUserfile /etc/httpd/conf/passwd
require valid-user


we have to provide http password for an user to view this website
#htpasswd -mc /etc/httpd/conf/passwd sam
(type password 2 times)

#service httpd restart

to check :

open mozilla ---clear private data ---in url type http://station17.redhat.com
(give username&password)




to restrict a particular user or particular system to access a website

#vi /etc/httpd/conf/httpd.conf


 Order Allow,deny
 Allow from all
 deny station12.redhat.com

( here we are denying station12.redhat.com)

to check try to open station17.redhat.com from station12 system


to create ssl certificate for an web server

#yum install openssl-* -y
#yum install mod-ssl-* -y


 # vi /etc/httpd/conf.d/ssl.conf
(line no134) #SSLCACertificateFile /etc/pki/tls/certs/ca-bundle.crt (remove #)
save&quit
#cd /etc/pki/tls/certs
 make genkey
 provide passphrase
#make testcert
passphrase(create with samepassword)
provide country,city,office,mailaddress
#service httpd restart


to run scripts

#vi test.sh
 #!/bin/bash
echo Content-Type:text/html
echo
--
date
ls -l
echo welcome to cyber services

save&quit
#mkdir -p /var/www/hml/cgi-bin
#cp -rf test.sh /var/www/html/cgi-bin/
#cd /var/www/html/cgi-bin/
#cd ..
#chown -R apache.apache cgi-bin
#cd cgi-bin
#chmod 755 test.sh
#vi /etc/httpd/conf/httpd.conf
add a line in website data
ScriptAlias /cgi-bin  "/var/www/html/cgi-bin"
save&quit
#service httpd restart
#setsebool -P httpd_tty_comm on
#setsebool -P httpd_enable_cgi 1
#setsebool -P httpd_sys_script_exec_t rw

to check:

open mozilla

type http://station17.redhat.com/cgi-bin


DNS Configuration in Linux (Redhat or CentOS 6)



                               DNS (Domain Naming Service)

DNS is a service which is used to resolve host to IP address and zone records & configuration files.

MASTER DNS :

There are two types of zonerecords
1) Forwad lookup zone
2) Reverse lookup zone

    By defaults, computer connects to another computer with the help of IP address

Forward lookup zone
--------------------
    It converts names into IP addresses


Reverse lookup zone
-------------------
    It converts IP addresses to names

Steps: 
#yum install bind-* caching-nameserver*-y
#service named start
#chkconfig named on
#cd /var/named/chroot/etc
#ls
#cp named-caching-nameserver named.conf
#vi named.conf
 delete ipv6 lines (line nos. 16 &22)

(line no15) Listen on port 53 {127.0.0.1; 192.168.0.254;}
(here 192.168.0.254 is server ip
(line no 21) allow-query  192.168.0.0/24 (clients range)
(line no 30) match-clients {local host; 192.168.0.0/24; } (here 192.168.0.0/24 is clients ip range & subnet mask)
(line no 31) match-destinations    {localhost; 192.168.0.0/24;}
save&quit

# vi /etc/rfc1912.zones
copy ten lines from 21 to 31 and paste under 31
change as follows
zone "redhat.com" IN {
 
  type master;
  file "redhat.for"
   allow-update { none; };
};
zone "0.168.192.IN-addr-arpa IN {
   type master;
   file "redhat.rev"
    allow-update { none; };
};

(here redhat.com is domain name and 0.168.192. is redhat.coms network range redhat.for is forward look up zone & redhat.rev is reverse lookup zone)
save & quit
# chgrp named named.conf
#chgrp named named.rfc1912.zones
#cd /var/named/chroot/var/named
#cp localhost.zone redhat.for
#cp named.local redhat.rev
# vi redhat.for

change as follows
$TTL    86400
@               IN SOA  redhat.com.       root.redhat.com. (
                                        42              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum

                IN NS           server1.redhat.com.
server1.redhat.com.             IN A            192.168.0.254
www254.redhat.com.           IN CNAME        server1.redhat.com.
station1.redhat.com.           IN A            192.168.0.1
www1.redhat.com.              IN CNAME        station1.redhat.com.
station2.redhat.com.          IN A            192.168.0.2
www2.redhat.com.             IN CNAME        station2.redhat.com.
xxx2.redhat.com.              IN CNAME        station2.redhat.com.
yyy2.redhat.com.              IN CNAME        station2.redhat.com.
station3.redhat.com.        IN A            192.168.0.3
www3.redhat.com.           IN CNAME        station3.redhat.com.
station4.redhat.com.        IN A            192.168.0.4
www4.redhat.com.           IN CNAME        station4.redhat.com.
station5.redhat.com.        IN A            192.168.0.5
www5.redhat.com.           IN CNAME        station5.redhat.com.
station6.redhat.com.            IN A            192.168.0.6
www6.redhat.com.                IN CNAME        station6.redhat.com.



(zone: zone is a storage database which contains all zone records

forward lookup zone: used for resolving hostname to ipaddress & it maintains host to ip mapping information
reverse lookup zone: used for resolving ip address to hostname & it maintains ip to hostname mapping information

types of records:
 
SOA : sort of authority the first record in any zone  it indicates who is authority for this domain
NS :nameserver it identifies the dns server for each zone
A record : resolves hostname to ip address
CNAME record : resolves an alias name to a hostname
PTR record : resolves an ipaddress to a hostname
MX record : resolves mail server ip (used by mail server)
TTL :time to live)

save & quit

#vi redhat.rev
(change as follows)
$TTL    86400
@       IN      SOA redhat.com.    root.redhat.com.  (
                                      1997022700 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                     86400 )    ; Minimum
            IN        NS      server1.redhat.com.
254      IN       PTR     server1.redhat.com.
1         IN       PTR     station1.redhat.com.
2        IN       PTR      station2.redhat.com.
3         IN      PTR     station3.redhat.com.
4         IN      PTR     station4.redhat.com.
5         IN      PTR     station5.redhat.com.
6         IN      PTR   station6.redhat.com.

save & quit

# chgrp named redhat.for
# chgrp named redhat.rev
# service named restart

to check:
#dig server1.redhat.com
#dig -x 192.168.0.1
(if answer is 1 server is ready if answer is 0 server has some error)



to check error in configuration file
#named-checkconf redhat.com /var/named/chroot/etc/named.conf


to check errors in zone record
 
#named-checkzone redhat.com /var/named/chroot/var/named/redhat.for
#named-checkzone redhat.com /var/named/chroot/var/named/redhat.rev






     
 SLAVE DNS

 Master DNS Server
It is the Master Copy of all the Zone Information.
It is Read/Write copy.


Slave DNS Server
It is Slave Backup of Master zone. It is Read Only

        if any error may occur to your dns server at the time the entir network will stop.sometimes it may cause huge damage.for that one we are createing slave dns for faulttolerance and load balancing.

we need another system which contains server o/s


steps

#yum install bind-* caching-nameserver -y
#service named start
#chkconfig named on
#cd /var/named/chroot/etc/named-rfc1912.zone

(change as follows)
copy 10 lines from 21 to 31 paste under 31
zone "redhat.com"
  type slave;
  file "redhat.for"
  masters {192.168.0.254:};

zone "0.168.192. IN-ADDR-arpa" IN {
  type slave ;
  file " redhat.rev"
  masters {192.168.0.254;};

save& quit

#service named restart


go to client
 
#i /etc/resolv.conf

nameserver 192.168.0.254
nameserver 192.168.0.1 (slave dns ip) 
 


                        
 FORWARDERS

        if you have trusted relationship with another company  those comapny users can enter into our network & our company users can enter into their network by using this forwarders


steps
in master dns server
 
# vi /var/named/chroot/etc/named.conf

add aline
 
 forwarders {192.168.10.254:};
 forward only ;
};
(here 192.168.10.254 is trusted companies dns)
save & quit

#service named restart


SAMBA Server Configuration in Linux (Redhat or CentOS 6)



SAMBA SERVER


    The samba server will provide user authentication via passwords and optionally domains. Samba can also try AFS(andrew file system) authentication, granting AFS rights if successfull or falling back to native password checking otherwise.

        Samba also has the ability through the winbindd daemon, to attach to a microsoft daemon password server.
        When a redhat linux is running  the winbindd service user accounts defined in the microsoft domain can be used to authenticate to the redhat linux machine.
Additionally in samba version 3.0 and later the samba services can use some microsoft active directory resources.

SAMBA SERVICES:
    Four main services of samba
1)Authentication and authorization of users
2)File and printer sharing
 
3)Name resolution
 
4)Browsing(service announcements)

Related:
    smbclient command line access
linux can mount a samba share using cifs and smbfs filesystem
 
    File and printer sharing is probably the most attractive samba feature for most users. With this functions users can easily retrive files or print to any printer over the network.


SERVICE PROFILE:
Type: System V-managed service
Packages: Samba,samba-common,samba-client
Daemons: /usr/sbin/nmbd,/usr/sbin/smbd
Script: /etc/init.d/smb
Ports: 137(-ns),138(-dgm),139(-ssh), 445(-ds)
Configuration file: /etc/samba/smb.conf
Related: system-config-samba,testparm

Steps to configure samba server:
#yum install samba-* -y
#service smb start
 
#chkconfig smb on
#vi /etc/samba/smb.conf
copy last 8 lines and paste under change as follows
[linux]
comment=
path=/exam(directory to be shared)
valid users=sam john
writable= yes
printable= no
hosts allow= 192.168.0.(allowable network)

here we are sharing /exam directory to sam and john they can read write /exam from any of 192.168.0. network system by using a share name linux
Note: we have to provide samba password for both users
 
#smbpasswd -a
samba passwords will store under /etc/samba/smbpasswd
To check syntax of configuration file:
#testparm
#service smb restart
#mkdir /exam
#chmod 777 /exam
(here we have to set selinux context )
#chcon -t samba_share_t /exam
#setsebool -P allow_smbd_anon_write=1



FROM LINUX CLIENT:
Note: Client must have samba-client package
 
#yum install samba-* -y
#service smb start
#service smb restart
#smbclient /// -U

try to get and put

to disconnect
 
smb> (type exit)


from windows client
 
Ist method :
 
right click on mynetwork places--- select mapnetwork drive--- choose a drive
in folderbox type \\\sharename
select finish
type username and password
 
try to create some files and folders

to disconnect 

rightclick on mynetwork places disconnect network drive
 
select drive click ok


IInd Method

start---run ----
\\\
provide username and password

to access user homedirectory
#setsebool -P samba_enable_home_dirs 1

from linux client

#smbclient /// -U

from windows client
start--run--\\\
provide username & password


to give directory for a specific group

vi /etc/samba/smb.conf
[]
path=
write list=@

ex:
[linux]
path=/exam
write list=@sales