How To Configure Samba As A Primary Domain Controller
How To Configure Samba As A Primary Domain Controller
How To Configure Samba As A Primary Domain Controller
Domain Controller
Configuring Samba Server as a Primary Domain Controller eases our requirement for a
centralized authentication server. Below are the steps required to configure it.
//
// Sample named.conf BIND DNS server 'named' configuration file
// for the Red Hat BIND distribution.
//
// See the BIND Administrator's Reference Manual (ARM) for details, in:
// file:///usr/share/doc/bind-*/arm/Bv9ARM.html
// Also see the BIND Configuration GUI : /usr/bin/system-config-bind and
// its manual.
//
options
{
// Those options should be used carefully because they disable port
// randomization
// query-source port 53;
// query-source-v6 port 53;
};
logging
{
/* If you want to enable debugging, eg. using the 'rndc trace' command,
* named will try to write the 'named.run' file in the $directory (/var/named).
* By default, SELinux policy does not allow named to modify the /var/named directory,
* so put the default debug log file in data/ :
*/
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
//
// All BIND 9 zones are in a "view", which allow different zones to be served
// to different types of client addresses, and for options to be set for groups
// of zones.
//
// By default, if named.conf contains no "view" clauses, all zones are in the
// "default" view, which matches all clients.
//
// If named.conf contains any "view" clause, then all zones MUST be in a view;
// so it is recommended to start off using views to avoid having to restructure
// your configuration files in the future.
//
include "/etc/named.rfc1912.zones";
// all views must contain the root hints zone:
include "/etc/named.root.hints";
// include "named.rfc1912.zones";
// you should not serve your rfc1912 names to non-localhost clients.
// These are your "authoritative" internal zones, and would probably
// also be included in the "localhost_resolver" view above :
zone "dynamite.com" IN {
type master;
file "dynamite.com.fz";
};
zone "1.168.192.in-addr.arpa" IN {
type master;
file "dynamite.com.rz";
};
$TTL 86400
@ IN SOA dns.dynamite.com. dnsadmin.dynamite.com. (
2111201101 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
@ IN NS dns.dynamite.com.
dns IN A 192.168.1.1
www IN CNAME dns
sambaldap IN A 192.168.1.2
winxp IN A 192.168.1.3
$TTL 86400
@ IN SOA dns.dynamite.com. dnsadmin.dynamite.com. (
2111201101 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS dns.dynamite.com.
1 IN PTR dns
2 IN PTR sambaldap
3 IN PTR winxp
Name: dns.dynamite.com
Address: 192.168.1.1
Name: sambaldap.dynamite.com
Address: 192.168.1.2
> www.dynamite.com
Server: 192.168.1.1
Address: 192.168.1.1#53
#######################################################################
## Attributes used by Samba 3.0 schema ##
#######################################################################
##
## Password hashes
##
attributetype ( 1.3.6.1.4.1.7165.2.1.24 NAME 'sambaLMPassword'
DESC 'LanManager Password'
EQUALITY caseIgnoreIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{32} SINGLE-VALUE )
##
## Account flags in string format ([UWDX ])
##
attributetype ( 1.3.6.1.4.1.7165.2.1.26 NAME 'sambaAcctFlags'
DESC 'Account Flags'
EQUALITY caseIgnoreIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{16} SINGLE-VALUE )
##
## Password timestamps & policies
##
attributetype ( 1.3.6.1.4.1.7165.2.1.27 NAME 'sambaPwdLastSet'
DESC 'Timestamp of the last password update'
EQUALITY integerMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
##
## string settings
##
attributetype ( 1.3.6.1.4.1.7165.2.1.33 NAME 'sambaHomeDrive'
DESC 'Driver letter of home directory mapping'
EQUALITY caseIgnoreIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{4} SINGLE-VALUE )
##
## SID, of any type
##
##
## Primary group SID, compatible with ntSid
##
##
## group mapping attributes
##
attributetype ( 1.3.6.1.4.1.7165.2.1.19 NAME 'sambaGroupType'
DESC 'NT Group Type'
EQUALITY integerMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
##
## Store info on the domain
##
# "password history"
attributetype ( 1.3.6.1.4.1.7165.2.1.59 NAME 'sambaPwdHistoryLength'
DESC 'Length of Password History Entries (default: 0 => off)'
EQUALITY integerMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
# "lockout duration"
attributetype ( 1.3.6.1.4.1.7165.2.1.63 NAME 'sambaLockoutDuration'
DESC 'Lockout duration in minutes (default: 30, -1 => forever)'
EQUALITY integerMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
# "disconnect time"
attributetype ( 1.3.6.1.4.1.7165.2.1.66 NAME 'sambaForceLogoff'
DESC 'Disconnect Users outside logon hours (default: -1 => off, 0 => on)'
EQUALITY integerMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
#######################################################################
## objectClasses used by Samba 3.0 schema ##
#######################################################################
## The X.500 data model (and therefore LDAPv3) says that each entry can
## only have one structural objectclass. OpenLDAP 2.0 does not enforce
## this currently but will in v2.1
##
## added new objectclass (and OID) for 3.0 to help us deal with backwards
## compatibility with 2.2 installations (e.g. ldapsam_compat) --jerry
##
objectclass ( 1.3.6.1.4.1.7165.2.2.6 NAME 'sambaSamAccount' SUP top AUXILIARY
DESC 'Samba 3.0 Auxilary SAM Account'
MUST ( uid $ sambaSID )
MAY ( cn $ sambaLMPassword $ sambaNTPassword $ sambaPwdLastSet $
sambaLogonTime $ sambaLogoffTime $ sambaKickoffTime $
sambaPwdCanChange $ sambaPwdMustChange $ sambaAcctFlags $
displayName $ sambaHomePath $ sambaHomeDrive $ sambaLogonScript $
sambaProfilePath $ description $ sambaUserWorkstations $
sambaPrimaryGroupSID $ sambaDomainName $ sambaMungedDial $
sambaBadPasswordCount $ sambaBadPasswordTime $
sambaPasswordHistory $ sambaLogonHours) )
##
## Group mapping info
##
objectclass ( 1.3.6.1.4.1.7165.2.2.4 NAME 'sambaGroupMapping' SUP top AUXILIARY
DESC 'Samba Group Mapping'
MUST ( gidNumber $ sambaSID $ sambaGroupType )
MAY ( displayName $ description $ sambaSIDList ) )
##
## Trust password for trust relationships (any kind)
##
objectclass ( 1.3.6.1.4.1.7165.2.2.14 NAME 'sambaTrustPassword' SUP top STRUCTURAL
DESC 'Samba Trust Password'
MUST ( sambaDomainName $ sambaNTPassword $ sambaTrustFlags )
MAY ( sambaSID $ sambaPwdLastSet ) )
##
## Whole-of-domain info
##
objectclass ( 1.3.6.1.4.1.7165.2.2.5 NAME 'sambaDomain' SUP top STRUCTURAL
DESC 'Samba Domain Information'
MUST ( sambaDomainName $ sambaSID )
MAY ( sambaNextRid $ sambaNextGroupRid $ sambaNextUserRid $
sambaAlgorithmicRidBase $
sambaMinPwdLength $ sambaPwdHistoryLength $ sambaLogonToChgPwd $
sambaMaxPwdAge $ sambaMinPwdAge $
sambaLockoutDuration $ sambaLockoutObservationWindow $
sambaLockoutThreshold $
sambaForceLogoff $ sambaRefuseMachinePwdChange ) )
##
## used for idmap_ldap module
##
objectclass ( 1.3.6.1.4.1.7165.2.2.7 NAME 'sambaUnixIdPool' SUP top AUXILIARY
DESC 'Pool for allocating UNIX uids/gids'
MUST ( uidNumber $ gidNumber ) )
include /etc/openldap/schema/core.schema
include /etc/openldap/schema/cosine.schema
include /etc/openldap/schema/inetorgperson.schema
include /etc/openldap/schema/nis.schema
include /etc/openldap/schema/samba.schema
loglevel -1
pidfile /var/run/openldap/slapd.pid
argsfile /var/run/openldap/slapd.args
#######################################################################
# ldbm and/or bdb database definitions
#######################################################################
database bdb
suffix "dc=dynamite,dc=com"
rootdn "cn=Manager,dc=dynamite,dc=com"
rootpw redhat
# rootpw {crypt}ijFYNcSNctBYg
directory /var/lib/ldap
# some attributes need to be readable anonymously so that 'id user' can answer correctly
access to attrs=objectClass,entry,homeDirectory,uid,uidNumber,gidNumber,memberUid
by dn="cn=samba,ou=DSA,dc=dynamite,dc=com" write
by dn="cn=smbldap-tools,dc=dynamite,dc=com" write
by dn="uid=root,ou=People,dc=dynamite,dc=com" write
by * read
#
# LDAP Defaults
#
#SIZELIMIT 12
#TIMELIMIT 15
#DEREF never
ssl no
tls_cacertdir /etc/openldap/cacerts
pam_password md5
[global]
workgroup = dynamite.com
netbios name = DYNAMITE
enable privileges = yes
#interfaces = 192.168.1.131
username map = /etc/samba/smbusers
log level = 0
syslog = 0
log file = /var/log/samba/log.%m
max log size = 100000
#time server = Yes
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
mangling method = hash2
Dos charset = 850
Unix charset = ISO8859-1
[homes]
comment = Home Directories
valid users = %U
read only = No
create mask = 0664
directory mask = 0775
browseable = No
[profiles]
path = /home/samba/profiles
read only = No
create mask = 0600
directory mask = 0700
browseable = No
guest ok = Yes
profile acls = Yes
csc policy = disable
force user = %U
valid users = %U @"Domain Admins"
[netlogon]
path = /home/samba/netlogon/
browseable = No
read only = yes
# $Source: $
# $Id: smbldap.conf,v 1.18 2005/05/27 14:28:47 jtournier Exp $
#
# smbldap-tools.conf : Q & D configuration file for smbldap-tools
# Purpose :
# . be the configuration file for all smbldap-tools scripts
##############################################################################
#
# General Configuration
#
##############################################################################
# Put your own SID. To obtain this number do: "net getlocalsid".
# If not defined, parameter is taking from "net getlocalsid" return
SID="S-1-5-21-3845255333-1124560154-2737011584"
##############################################################################
#
# LDAP Configuration
#
##############################################################################
# Notes: to use to dual ldap servers backend for Samba, you must patch
# Samba with the dual-head patch from IDEALX. If not using this patch
# just use the same server for slaveLDAP and masterLDAP.
# Those two servers declarations can also be used when you have
# . one master LDAP server where all writing operations must be done
# . one slave LDAP server where all reading operations must be done
# (typically a replication directory)
# CA certificate
# see "man Net::LDAP" in start_tls section for more details
#cafile="/etc/smbldap-tools/ca.pem"
# LDAP Suffix
# Ex: suffix=dc=IDEALX,dc=ORG
suffix="dc=dynamite,dc=com"
# Where are stored Idmap entries (used if samba is a domain member server)
# Ex: groupsdn="ou=Idmap,dc=IDEALX,dc=ORG"
# Warning: if 'suffix' is not set here, you must set the full dn for idmapdn
idmapdn="ou=Idmap,${suffix}"
# Where to store next uidNumber and gidNumber available for new users and groups
# If not defined, entries are stored in sambaDomainName object.
# Ex: sambaUnixIdPooldn="sambaDomainName=${sambaDomain},${suffix}"
# Ex: sambaUnixIdPooldn="cn=NextFreeUnixId,${suffix}"
sambaUnixIdPooldn="sambaDomainName=${sambaDomain},${suffix}"
##############################################################################
#
# Unix Accounts Configuration
#
##############################################################################
# Login defs
# Default Login Shell
# Ex: userLoginShell="/bin/bash"
userLoginShell="/bin/bash"
# Home directory
# Ex: userHome="/home/%U"
userHome="/home/%U"
# Gecos
userGecos="System User"
# Default User (POSIX and Samba) GID
defaultUserGid="513"
# Skel dir
skeletonDir="/etc/skel"
# Default password validation time (time in days) Comment the next line if
# you don't want password to be enable for defaultMaxPasswordAge days (be
# careful to the sambaPwdMustChange attribute's value)
defaultMaxPasswordAge="45"
##############################################################################
#
# SAMBA Configuration
#
##############################################################################
##############################################################################
#
# SMBLDAP-TOOLS Configuration (default are ok for a RedHat)
#
##############################################################################
# Allows not to use smbpasswd (if with_smbpasswd == 0 in smbldap_conf.pm) but
# prefer Crypt::SmbHash library
with_smbpasswd="0"
smbpasswd="/usr/bin/smbpasswd"
# comment out the following line to get rid of the default banner
# no_banner="1"
dn: ou=DSA,dc=example,dc=com
objectClass: top
objectClass: organizationalUnit
ou: DSA
description: Security Accounts For LDAP Clients
dn: cn=samba,ou=DSA,dc=example,dc=com
objectclass: organizationalRole
objectClass: top
objectClass: simpleSecurityObject
userPassword: sambasecretpwd
cn: samba
dn: cn=nssldap,ou=DSA,dc=example,dc=com
objectclass: organizationalRole
objectClass: top
objectClass: simpleSecurityObject
userPassword: nssldapsecretpwd
cn: nssldap
dn: cn=smbtools,ou=DSA,dc=example,dc=com
objectclass: organizationalRole
objectClass: top
objectClass: simpleSecurityObject
userPassword: smbtoolssecretpwd
cn: smbtools
Note : Whenever an account is created with smbldap tools in LDAP, the same account must also be
created in local accounts database i.e. /etc/passwd
On Windows XP Machine Right Click My Computer -> Properties -> Select Computer Name tab -> Click
Change -> Select input computer name and select Domain and input dynamite.com -> Click OK ->
Provide the domain account credentials
i.e. (UserName: root & Password: abc123)
Login with the other user accounts into DYNAMITE.COM domain and confirm that they are able to
access the network resources.
Add a comment
Home
10
12
Installing & Configuring OpenLDAP Server On CentOS 6.4
62
How to Record All Incoming & Outgoing Mails To Seperate Email Addresses In
Postfix
Monitor & Record all Shell Commands & Send Logs to Centralized RSyslog
Server
10
13
2
Configuring iSCSI Target & Inititator on CentOS
Installing & Configuring Linux Load Balancer Cluster (Direct Routing Method)
6) Start the xinetd, httpd, cobbler services and start the necessary at boot time
[root@cobbler ~]# for i in xinetd httpd cobblerd; do service $i
restart; chkconfig $i on; done;
[root@cobbler ~]# chkconfig tftp on
[root@cobbler ~]# chkconfig rsync on
8) Change the default template of the dhcp file included with cobbler to match your
network
[root@cobbler ~]# cp /etc/cobbler/dhcp.template
/etc/cobbler/dhcp.template.org
[root@cobbler ~]# vim /etc/cobbler/dhcp.template
allow booting;
allow bootp;
ignore client-updates;
set vendorclass = option vendor-class-identifier;
option pxe-system-type code 93 = unsigned integer 16;
subnet 192.168.75.0 netmask 255.255.255.0 {
option routers 192.168.75.1;
option subnet-mask 255.255.255.0;
range dynamic-bootp 192.168.75.100 192.168.75.254;
default-lease-time 21600;
max-lease-time 43200;
next-server 192.168.75.222;
class "pxeclients" {
match if substring (option vendor-class-identifier, 0,
9) = "PXEClient";
if option pxe-system-type = 00:02 {
filename "ia64/elilo.efi";
} else if option pxe-system-type = 00:06 {
filename "grub/grub-x86.efi";
} else if option pxe-system-type = 00:07 {
filename "grub/grub-x86_64.efi";
} else {
filename "pxelinux.0";
}
}
10) Mount your CentOS 6.5 DVD to a mount point, here I am mounting on /mnt
[root@cobbler ~]# mount /dev/sr0 /mnt
11) Import the Distro details into cobbler using the below command (It takes time to
copy the distro data into /var/www/cobbler/. So be patient)
[root@cobbler ~]# cobbler import --path=/mnt --
name=CentOS_6.5_x86_64
12) Copy the default anaconda-ks.cfg to the default location of cobbler kickstart files
[root@cobbler ~]# cp anaconda-ks.cfg
/var/lib/cobbler/kickstarts/centos65.ks
13) Modify the centos65.ks file to the following or according to your requirement
[root@cobbler ~]# vim /var/lib/cobbler/kickstarts/centos65.ks
install
url --url
http://192.168.75.222/cobbler/ks_mirror/CentOS_6.5_x86_64/
lang en_US.UTF-8
zerombr
keyboard us
network --onboot yes --device eth0 --bootproto dhcp --noipv6
rootpw --iscrypted
$6$4t6CgzQlwQKVFUEb$.mWJx35kMLobSabwpoKzlVpTvmTjxapy5GjSJdWkWANg
V9J0SE4tm/oYMQjOYFdAyp5FgpevxXmzyy5/3xcHS.
firewall --service=ssh
authconfig --enableshadow --passalgo=sha512
selinux --enforcing
timezone Asia/Kolkata
bootloader --location=mbr --driveorder=sda --
append="crashkernel=auto rhgb quiet"
14) Add the distro information to the cobbler for PXE Boot
[root@cobbler ~]# cobbler distro add --name=CentOS_6.5_x86_64 --
kernel=/var/www/cobbler/ks_mirror/CentOS_6.5_x86_64/isolinux/vml
inuz --
initrd=/var/www/cobbler/ks_mirror/CentOS_6.5_x86_64/isolinux/ini
trd.img
16) Restart and synchronize the changes that were made into cobbler
[root@cobbler ~]# service cobblerd restart
[root@cobbler ~]# cobbler sync
18) Restart the below services once again to make sure all the changes are applied to
the services
[root@cobbler ~]# for i in xinetd httpd cobblerd; do service $i
restart; chkconfig $i on; done;
19) Boot a new linux machine and make sure it boots via Network and at the menu
prompt select the CentOS_6.5_KS option
How To Configure Samba As A Primary
Domain Controller
Configuring Samba Server as a Primary Domain Controller eases our requirement for a
centralized authentication server. Below are the steps required to configure it.
//
// Sample named.conf BIND DNS server 'named' configuration file
// for the Red Hat BIND distribution.
//
// See the BIND Administrator's Reference Manual (ARM) for details, in:
// file:///usr/share/doc/bind-*/arm/Bv9ARM.html
// Also see the BIND Configuration GUI : /usr/bin/system-config-bind and
// its manual.
//
options
{
// Those options should be used carefully because they disable port
// randomization
// query-source port 53;
// query-source-v6 port 53;
};
logging
{
/* If you want to enable debugging, eg. using the 'rndc trace' command,
* named will try to write the 'named.run' file in the $directory (/var/named).
* By default, SELinux policy does not allow named to modify the /var/named directory,
* so put the default debug log file in data/ :
*/
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
//
// All BIND 9 zones are in a "view", which allow different zones to be served
// to different types of client addresses, and for options to be set for groups
// of zones.
//
// By default, if named.conf contains no "view" clauses, all zones are in the
// "default" view, which matches all clients.
//
// If named.conf contains any "view" clause, then all zones MUST be in a view;
// so it is recommended to start off using views to avoid having to restructure
// your configuration files in the future.
//
include "/etc/named.rfc1912.zones";
// all views must contain the root hints zone:
include "/etc/named.root.hints";
// include "named.rfc1912.zones";
// you should not serve your rfc1912 names to non-localhost clients.
// These are your "authoritative" internal zones, and would probably
// also be included in the "localhost_resolver" view above :
zone "dynamite.com" IN {
type master;
file "dynamite.com.fz";
};
zone "1.168.192.in-addr.arpa" IN {
type master;
file "dynamite.com.rz";
};
$TTL 86400
@ IN SOA dns.dynamite.com. dnsadmin.dynamite.com. (
2111201101 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
@ IN NS dns.dynamite.com.
dns IN A 192.168.1.1
www IN CNAME dns
sambaldap IN A 192.168.1.2
winxp IN A 192.168.1.3
$TTL 86400
@ IN SOA dns.dynamite.com. dnsadmin.dynamite.com. (
2111201101 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS dns.dynamite.com.
1 IN PTR dns
2 IN PTR sambaldap
3 IN PTR winxp
Name: dns.dynamite.com
Address: 192.168.1.1
Name: sambaldap.dynamite.com
Address: 192.168.1.2
> www.dynamite.com
Server: 192.168.1.1
Address: 192.168.1.1#53
#######################################################################
## Attributes used by Samba 3.0 schema ##
#######################################################################
##
## Password hashes
##
attributetype ( 1.3.6.1.4.1.7165.2.1.24 NAME 'sambaLMPassword'
DESC 'LanManager Password'
EQUALITY caseIgnoreIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{32} SINGLE-VALUE )
##
## Account flags in string format ([UWDX ])
##
attributetype ( 1.3.6.1.4.1.7165.2.1.26 NAME 'sambaAcctFlags'
DESC 'Account Flags'
EQUALITY caseIgnoreIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{16} SINGLE-VALUE )
##
## Password timestamps & policies
##
attributetype ( 1.3.6.1.4.1.7165.2.1.27 NAME 'sambaPwdLastSet'
DESC 'Timestamp of the last password update'
EQUALITY integerMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
##
## string settings
##
attributetype ( 1.3.6.1.4.1.7165.2.1.33 NAME 'sambaHomeDrive'
DESC 'Driver letter of home directory mapping'
EQUALITY caseIgnoreIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{4} SINGLE-VALUE )
##
## SID, of any type
##
##
## Primary group SID, compatible with ntSid
##
##
## group mapping attributes
##
attributetype ( 1.3.6.1.4.1.7165.2.1.19 NAME 'sambaGroupType'
DESC 'NT Group Type'
EQUALITY integerMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
##
## Store info on the domain
##
attributetype ( 1.3.6.1.4.1.7165.2.1.21 NAME 'sambaNextUserRid'
DESC 'Next NT rid to give our for users'
EQUALITY integerMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
# "password history"
attributetype ( 1.3.6.1.4.1.7165.2.1.59 NAME 'sambaPwdHistoryLength'
DESC 'Length of Password History Entries (default: 0 => off)'
EQUALITY integerMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
# "lockout duration"
attributetype ( 1.3.6.1.4.1.7165.2.1.63 NAME 'sambaLockoutDuration'
DESC 'Lockout duration in minutes (default: 30, -1 => forever)'
EQUALITY integerMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
# "disconnect time"
attributetype ( 1.3.6.1.4.1.7165.2.1.66 NAME 'sambaForceLogoff'
DESC 'Disconnect Users outside logon hours (default: -1 => off, 0 => on)'
EQUALITY integerMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
#######################################################################
## objectClasses used by Samba 3.0 schema ##
#######################################################################
## The X.500 data model (and therefore LDAPv3) says that each entry can
## only have one structural objectclass. OpenLDAP 2.0 does not enforce
## this currently but will in v2.1
##
## added new objectclass (and OID) for 3.0 to help us deal with backwards
## compatibility with 2.2 installations (e.g. ldapsam_compat) --jerry
##
objectclass ( 1.3.6.1.4.1.7165.2.2.6 NAME 'sambaSamAccount' SUP top AUXILIARY
DESC 'Samba 3.0 Auxilary SAM Account'
MUST ( uid $ sambaSID )
MAY ( cn $ sambaLMPassword $ sambaNTPassword $ sambaPwdLastSet $
sambaLogonTime $ sambaLogoffTime $ sambaKickoffTime $
sambaPwdCanChange $ sambaPwdMustChange $ sambaAcctFlags $
displayName $ sambaHomePath $ sambaHomeDrive $ sambaLogonScript $
sambaProfilePath $ description $ sambaUserWorkstations $
sambaPrimaryGroupSID $ sambaDomainName $ sambaMungedDial $
sambaBadPasswordCount $ sambaBadPasswordTime $
sambaPasswordHistory $ sambaLogonHours) )
##
## Group mapping info
##
objectclass ( 1.3.6.1.4.1.7165.2.2.4 NAME 'sambaGroupMapping' SUP top AUXILIARY
DESC 'Samba Group Mapping'
MUST ( gidNumber $ sambaSID $ sambaGroupType )
MAY ( displayName $ description $ sambaSIDList ) )
##
## Trust password for trust relationships (any kind)
##
objectclass ( 1.3.6.1.4.1.7165.2.2.14 NAME 'sambaTrustPassword' SUP top STRUCTURAL
DESC 'Samba Trust Password'
MUST ( sambaDomainName $ sambaNTPassword $ sambaTrustFlags )
MAY ( sambaSID $ sambaPwdLastSet ) )
##
## Whole-of-domain info
##
objectclass ( 1.3.6.1.4.1.7165.2.2.5 NAME 'sambaDomain' SUP top STRUCTURAL
DESC 'Samba Domain Information'
MUST ( sambaDomainName $ sambaSID )
MAY ( sambaNextRid $ sambaNextGroupRid $ sambaNextUserRid $
sambaAlgorithmicRidBase $
sambaMinPwdLength $ sambaPwdHistoryLength $ sambaLogonToChgPwd $
sambaMaxPwdAge $ sambaMinPwdAge $
sambaLockoutDuration $ sambaLockoutObservationWindow $
sambaLockoutThreshold $
sambaForceLogoff $ sambaRefuseMachinePwdChange ) )
##
## used for idmap_ldap module
##
objectclass ( 1.3.6.1.4.1.7165.2.2.7 NAME 'sambaUnixIdPool' SUP top AUXILIARY
DESC 'Pool for allocating UNIX uids/gids'
MUST ( uidNumber $ gidNumber ) )
include /etc/openldap/schema/core.schema
include /etc/openldap/schema/cosine.schema
include /etc/openldap/schema/inetorgperson.schema
include /etc/openldap/schema/nis.schema
include /etc/openldap/schema/samba.schema
loglevel -1
pidfile /var/run/openldap/slapd.pid
argsfile /var/run/openldap/slapd.args
#######################################################################
# ldbm and/or bdb database definitions
#######################################################################
database bdb
suffix "dc=dynamite,dc=com"
rootdn "cn=Manager,dc=dynamite,dc=com"
rootpw redhat
# rootpw {crypt}ijFYNcSNctBYg
directory /var/lib/ldap
# some attributes need to be readable anonymously so that 'id user' can answer correctly
access to attrs=objectClass,entry,homeDirectory,uid,uidNumber,gidNumber,memberUid
by dn="cn=samba,ou=DSA,dc=dynamite,dc=com" write
by dn="cn=smbldap-tools,dc=dynamite,dc=com" write
by dn="uid=root,ou=People,dc=dynamite,dc=com" write
by * read
#
# LDAP Defaults
#
#SIZELIMIT 12
#TIMELIMIT 15
#DEREF never
ssl no
tls_cacertdir /etc/openldap/cacerts
pam_password md5
log level = 0
syslog = 0
log file = /var/log/samba/log.%m
max log size = 100000
#time server = Yes
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
mangling method = hash2
Dos charset = 850
Unix charset = ISO8859-1
[homes]
comment = Home Directories
valid users = %U
read only = No
create mask = 0664
directory mask = 0775
browseable = No
[profiles]
path = /home/samba/profiles
read only = No
create mask = 0600
directory mask = 0700
browseable = No
guest ok = Yes
profile acls = Yes
csc policy = disable
force user = %U
valid users = %U @"Domain Admins"
[netlogon]
path = /home/samba/netlogon/
browseable = No
read only = yes
# $Source: $
# $Id: smbldap.conf,v 1.18 2005/05/27 14:28:47 jtournier Exp $
#
# smbldap-tools.conf : Q & D configuration file for smbldap-tools
# Purpose :
# . be the configuration file for all smbldap-tools scripts
##############################################################################
#
# General Configuration
#
##############################################################################
# Put your own SID. To obtain this number do: "net getlocalsid".
# If not defined, parameter is taking from "net getlocalsid" return
SID="S-1-5-21-3845255333-1124560154-2737011584"
##############################################################################
#
# LDAP Configuration
#
##############################################################################
# Notes: to use to dual ldap servers backend for Samba, you must patch
# Samba with the dual-head patch from IDEALX. If not using this patch
# just use the same server for slaveLDAP and masterLDAP.
# Those two servers declarations can also be used when you have
# . one master LDAP server where all writing operations must be done
# . one slave LDAP server where all reading operations must be done
# (typically a replication directory)
# CA certificate
# see "man Net::LDAP" in start_tls section for more details
#cafile="/etc/smbldap-tools/ca.pem"
# LDAP Suffix
# Ex: suffix=dc=IDEALX,dc=ORG
suffix="dc=dynamite,dc=com"
# Where are stored Idmap entries (used if samba is a domain member server)
# Ex: groupsdn="ou=Idmap,dc=IDEALX,dc=ORG"
# Warning: if 'suffix' is not set here, you must set the full dn for idmapdn
idmapdn="ou=Idmap,${suffix}"
# Where to store next uidNumber and gidNumber available for new users and groups
# If not defined, entries are stored in sambaDomainName object.
# Ex: sambaUnixIdPooldn="sambaDomainName=${sambaDomain},${suffix}"
# Ex: sambaUnixIdPooldn="cn=NextFreeUnixId,${suffix}"
sambaUnixIdPooldn="sambaDomainName=${sambaDomain},${suffix}"
##############################################################################
#
# Unix Accounts Configuration
#
##############################################################################
# Login defs
# Default Login Shell
# Ex: userLoginShell="/bin/bash"
userLoginShell="/bin/bash"
# Home directory
# Ex: userHome="/home/%U"
userHome="/home/%U"
# Gecos
userGecos="System User"
# Default User (POSIX and Samba) GID
defaultUserGid="513"
# Skel dir
skeletonDir="/etc/skel"
# Default password validation time (time in days) Comment the next line if
# you don't want password to be enable for defaultMaxPasswordAge days (be
# careful to the sambaPwdMustChange attribute's value)
defaultMaxPasswordAge="45"
##############################################################################
#
# SAMBA Configuration
#
##############################################################################
##############################################################################
#
# SMBLDAP-TOOLS Configuration (default are ok for a RedHat)
#
##############################################################################
# comment out the following line to get rid of the default banner
# no_banner="1"
dn: ou=DSA,dc=example,dc=com
objectClass: top
objectClass: organizationalUnit
ou: DSA
description: Security Accounts For LDAP Clients
dn: cn=samba,ou=DSA,dc=example,dc=com
objectclass: organizationalRole
objectClass: top
objectClass: simpleSecurityObject
userPassword: sambasecretpwd
cn: samba
dn: cn=nssldap,ou=DSA,dc=example,dc=com
objectclass: organizationalRole
objectClass: top
objectClass: simpleSecurityObject
userPassword: nssldapsecretpwd
cn: nssldap
dn: cn=smbtools,ou=DSA,dc=example,dc=com
objectclass: organizationalRole
objectClass: top
objectClass: simpleSecurityObject
userPassword: smbtoolssecretpwd
cn: smbtools
Note : Whenever an account is created with smbldap tools in LDAP, the same account must also be
created in local accounts database i.e. /etc/passwd
On Windows XP Machine Right Click My Computer -> Properties -> Select Computer Name tab -> Click
Change -> Select input computer name and select Domain and input dynamite.com -> Click OK ->
Provide the domain account credentials
i.e. (UserName: root & Password: abc123)
Login with the other user accounts into DYNAMITE.COM domain and confirm that they are able to
access the network resources.
Add a comment
Home
10
62
How to Record All Incoming & Outgoing Mails To Seperate Email Addresses In
Postfix
Monitor & Record all Shell Commands & Send Logs to Centralized RSyslog
Server
10
13
Installing & Configuring Linux Load Balancer Cluster (Direct Routing Method)
Here in my example, my machine name is cobbler and its IP is 192.168.75.222 and its
running CentOS 6.5 x86_64 version
6) Start the xinetd, httpd, cobbler services and start the necessary at boot time
[root@cobbler ~]# for i in xinetd httpd cobblerd; do service $i
restart; chkconfig $i on; done;
[root@cobbler ~]# chkconfig tftp on
[root@cobbler ~]# chkconfig rsync on
8) Change the default template of the dhcp file included with cobbler to match your
network
[root@cobbler ~]# cp /etc/cobbler/dhcp.template
/etc/cobbler/dhcp.template.org
[root@cobbler ~]# vim /etc/cobbler/dhcp.template
allow booting;
allow bootp;
ignore client-updates;
set vendorclass = option vendor-class-identifier;
option pxe-system-type code 93 = unsigned integer 16;
subnet 192.168.75.0 netmask 255.255.255.0 {
option routers 192.168.75.1;
option subnet-mask 255.255.255.0;
range dynamic-bootp 192.168.75.100 192.168.75.254;
default-lease-time 21600;
max-lease-time 43200;
next-server 192.168.75.222;
class "pxeclients" {
match if substring (option vendor-class-identifier, 0,
9) = "PXEClient";
if option pxe-system-type = 00:02 {
filename "ia64/elilo.efi";
} else if option pxe-system-type = 00:06 {
filename "grub/grub-x86.efi";
} else if option pxe-system-type = 00:07 {
filename "grub/grub-x86_64.efi";
} else {
filename "pxelinux.0";
}
}
10) Mount your CentOS 6.5 DVD to a mount point, here I am mounting on /mnt
[root@cobbler ~]# mount /dev/sr0 /mnt
11) Import the Distro details into cobbler using the below command (It takes time to
copy the distro data into /var/www/cobbler/. So be patient)
[root@cobbler ~]# cobbler import --path=/mnt --
name=CentOS_6.5_x86_64
12) Copy the default anaconda-ks.cfg to the default location of cobbler kickstart files
[root@cobbler ~]# cp anaconda-ks.cfg
/var/lib/cobbler/kickstarts/centos65.ks
13) Modify the centos65.ks file to the following or according to your requirement
[root@cobbler ~]# vim /var/lib/cobbler/kickstarts/centos65.ks
install
url --url
http://192.168.75.222/cobbler/ks_mirror/CentOS_6.5_x86_64/
lang en_US.UTF-8
zerombr
keyboard us
network --onboot yes --device eth0 --bootproto dhcp --noipv6
rootpw --iscrypted
$6$4t6CgzQlwQKVFUEb$.mWJx35kMLobSabwpoKzlVpTvmTjxapy5GjSJdWkWANg
V9J0SE4tm/oYMQjOYFdAyp5FgpevxXmzyy5/3xcHS.
firewall --service=ssh
authconfig --enableshadow --passalgo=sha512
selinux --enforcing
timezone Asia/Kolkata
bootloader --location=mbr --driveorder=sda --
append="crashkernel=auto rhgb quiet"
14) Add the distro information to the cobbler for PXE Boot
[root@cobbler ~]# cobbler distro add --name=CentOS_6.5_x86_64 --
kernel=/var/www/cobbler/ks_mirror/CentOS_6.5_x86_64/isolinux/vml
inuz --
initrd=/var/www/cobbler/ks_mirror/CentOS_6.5_x86_64/isolinux/ini
trd.img
16) Restart and synchronize the changes that were made into cobbler
[root@cobbler ~]# service cobblerd restart
[root@cobbler ~]# cobbler sync
18) Restart the below services once again to make sure all the changes are applied to
the services
[root@cobbler ~]# for i in xinetd httpd cobblerd; do service $i
restart; chkconfig $i on; done;
19) Boot a new linux machine and make sure it boots via Network and at the menu
prompt select the CentOS_6.5_KS option
Posted 1st February 2014 by Nagoor
9
View comments
1.
Cheers!.
IM
Reply
2.
Nice tutorial :)
But how to deploy Ubuntu and Windows OS using this tool ?
Thnx
Reply
3.
Reply
4.
Reply
5.
https://www.youtube.com/watch?v=Cx6X6Ar926o
https://www.youtube.com/watch?v=NhmZPjUZ5ck
language is different, but follow the video to deploy windows/vmware like stuff.
also to inform that through xboot(windows tools, can be found in youtube)
https://www.youtube.com/watch?v=foaHlZezdjk, we can create multiple OS bootable
and can be deploy through PXE.
Reply
6.
Nice post.We providing Red Hat Linux Online training.Red hat Linux Online Training
Reply
7.
Red hat Linux Online training provided by Smart mind Online training in all the
necessary concepts of the cloud. The curriculum of the training should include the
installation and configuration of the Red Hat Enterprise Linux Open Stack Platform. The
rules, protocols, flavors, projects and users must be well managed. Configuration and
management of the images, and nodes computing are to be trained.
Red Hat Linux Online Training
Reply
8.
Nice article
Thanks for sharing the informative blog.
Reply
9.
I followed the same steps but I was getting error while installing new server with pxe
boot.
The client machine wasn't able to discovery the dhcp server settings.
Please let me know what is kind of type-2 hyp are you using and how you were able to
get discovery the dhcp settings for client machines.
1. When you import the distro it will create distro as well profile. But you have re-added
distro and profile. I think you need to edit the existing disto and profile to change paths of
kernel, initrd and kickstart.
2. How did you get the cobbler.org domain for pxe boot?
Reply
Loading
Powered by Blogger.
Copy the below text into /etc/openldap/slapd.conf at the end of the file
[root@ldap1 ~]# vim /etc/openldap/slapd.conf
# Uncomment the module in the modules section
moduleload ppolicy.la
# Password Policy Configuration
overlay ppolicy
ppolicy_default "cn=default,ou=Policies,dc=example,dc=com"
ppolicy_use_lockout
ppolicy_hash_cleartext
Convert the slapd.conf to cn=config format and re-initialize the slapd.d folder
[root@ldap1 ~]# rm -rf /etc/openldap/slapd.d/*
[root@ldap1 ~]# slaptest -u
[root@ldap1 ~]# slaptest -f /etc/openldap/slapd.conf -F
/etc/openldap/slapd.d/
For more information and settings on password policy please refer to this link below
http://www.zytrax.com/books/ldap/ch6/ppolicy.html
Posted 20th November 2013 by Nagoor
In my previous post, I have shown you how to configure OpenLDAP Server with
SASL/TLS.
If you dont know how to configure, please visit this link
http://easylinuxtutorials.blogspot.in/2013/11/installing-configuring-openldap-
server.html
1) Copy the LDAP1 server public key file to the LDAP2 server and LDAP2 server public
key file to LDAP1 server in this location /etc/openldap/certs
[root@ldap1 ~]# scp ldap2:/etc/pki/tls/certs/ldap2pub.pem
/etc/openldap/certs/
[root@ldap1 ~]# scp /etc/pki/tls/certs/ldap1pub.pem
ldap2:/etc/openldap/certs/
2) Set the permissions on the copied public key files to ldap on LDAP1 and LDAP2
Servers
[root@ldap1 ~]# chown ldap. /etc/openldap/certs/ldap2pub.pem
[root@ldap2 ~]# chown ldap. /etc/openldap/certs/ldap1pub.pem
include /etc/openldap/schema/corba.schema
include /etc/openldap/schema/core.schema
include /etc/openldap/schema/cosine.schema
include /etc/openldap/schema/duaconf.schema
include /etc/openldap/schema/dyngroup.schema
include /etc/openldap/schema/inetorgperson.schema
include /etc/openldap/schema/java.schema
include /etc/openldap/schema/misc.schema
include /etc/openldap/schema/nis.schema
include /etc/openldap/schema/openldap.schema
include /etc/openldap/schema/ppolicy.schema
include /etc/openldap/schema/collective.schema
pidfile /var/run/openldap/slapd.pid
argsfile /var/run/openldap/slapd.args
# modulepath /usr/lib/openldap
# modulepath /usr/lib64/openldap
# moduleload accesslog.la
# moduleload auditlog.la
# moduleload back_sql.la
# moduleload chain.la
# moduleload collect.la
# moduleload constraint.la
# moduleload dds.la
# moduleload deref.la
# moduleload dyngroup.la
# moduleload dynlist.la
# moduleload memberof.la
# moduleload pbind.la
# moduleload pcache.la
# moduleload ppolicy.la
# moduleload refint.la
# moduleload retcode.la
# moduleload rwm.la
# moduleload seqmod.la
# moduleload smbk5pwd.la
# moduleload sssvlv.la
moduleload syncprov.la
# moduleload translucent.la
# moduleload unique.la
# moduleload valsort.la
################################################################
#######
# database definitions
################################################################
#######
database bdb
suffix "dc=example,dc=com"
checkpoint 1024 15
rootdn "cn=Manager,dc=example,dc=com"
rootpw {SSHA}5h1vaYgy7fOLash39ZFKLQ3TOzqNYk/g
loglevel 256
sizelimit unlimited
# Cleartext passwords, especially for the rootdn, should
# be avoided. See slappasswd(8) and slapd.conf(5) for details.
# Use of strong authentication encouraged.
# rootpw secret
# rootpw {crypt}ijFYNcSNctBYg
4) Convert the slapd.conf to cn=config format and re-initialize the slapd.d folder
on LDAP1 and LDAP2 Servers
[root@ldap1 ~]# rm -rf /etc/openldap/slapd.d/*
[root@ldap1 ~]# slaptest -u
[root@ldap1 ~]# slaptest -f /etc/openldap/slapd.conf -F
/etc/openldap/slapd.d/
7) Check whether replication is working or not by adding an entry into DIT on both
servers, the entry should be visible by ldapsearch on both server if it is added on
anyone of them.
8) If there is any problem in replication check the log file /var/log/ldap for more
information and troubleshooting.
rid -> replica ID for servers, which should be numeric and unique for each
server
provider -> URI of ldap server which will be the master server
type -> type of synchronization between LDAP servers for replication
interval -> time interval for initial synchronization process i.e. 10 secs here
retry -> retry the synchronization process if incase consumer is not available
i.e. retry 10 times every 5 seconds, if it fails and then every 60 sec it will
continue
timeout -> timeout incase of failure in retry i.e. 1 sec
schemachecking -> off means will not check for schema during schema
searchbase -> search base that will be replicated to the other server
scope -> sub means all the sub DNs will be replicated
bindmethod -> connection type for replication process
binddn -> the user authorized for replication process
credentials -> user password for the user initiating the replication process
Pre-requisites:
Working DNS Server : If you don't know how to configure DNS, please click the
link for step by step configuration of BIND DNS
http://easylinuxtutorials.blogspot.com/2011/11/setting-up-dns-server-in-rhel-
6.html
Server should be synced with NTP Server. Please follow my post for NTP Server
configuration
Disable SELinux
pidfile /var/run/openldap/slapd.pid
I have a CentOS 6.3 x86_64 Minimal install system. In CentOS 6, postfix is installed
and will be running by default.
Pre-requesites:
1) Working DNS Server : Incase you dont know how to configure, please look at this
link to configure BIND DNS Server
http://easylinuxtutorials.blogspot.in/2011/11/setting-up-dns-server-in-rhel-6.html
Create the postfix lookup table using the postmap command. Postmap is utility
program that will convert /etc/postfix/incoming to
/etc/postfix/incoming.db in Berkley DB format, so that Postfix can access the
data faster.
[root@mail ~]# postmap /etc/postfix/incoming
[root@mail ~]# postmap /etc/postfix/outgoing
Restart the postfix service and make service available during startup
[root@mail ~]# service postfix restart
Test the configuration by sending a mail to any user on the system it will recorded in
inmails user mailbox and outmails user mailbox as well.
Here
stat -> status of the process
euser -> effective user
ruser -> real user
%mem -> percentage of memory utilized by process
pid -> process ID
%cpu -> percentage of memory utilized by process
comm -> command
2) Create a user named nagios and assign any password for it.
[root@server ~]# useradd -m nagios
[root@server ~]# passwd nagios
10) Incase SELinux is in enforcing mode then change the SELinux context to accept
nagios configuration, otherwise this step is not necessary
[root@server nagios-plugins-1.5]# chcon -R -t
httpd_sys_content_t /usr/local/nagios/sbin/
[root@server nagios-plugins-1.5]# chcon -R -t
httpd_sys_content_t /usr/local/nagios/share/
[root@server nagios-plugins-1.5]# service httpd restart
[root@server nagios-plugins-1.5]# service nagios restart
In this demo I have a couple of CentOS 6.3 x86_64 machines with minimal installation.
1) Rsyslog is installed by default on CentOS machines, incase its not installed, install
the Rsyslog package on both Client and Server.
[root@server ~]# yum install rsyslog -y
[root@client ~]# yum install rsyslog -y
2) Edit the /etc/bashrc to record the shell commands that are executed
[root@client ~]# vim /etc/bashrc
Add this line to the end of file
remoteip=$(who am i | awk '{print $5}' | sed "s/[()]//g" )
export PROMPT_COMMAND='RETRN_VAL=$?;logger -p local3.debug
"$(whoami) $remoteip [$$]: $(history 1 | sed "s/^[ ]*[0-9]\+[
]*//" ) [$RETRN_VAL]"'
5) Log off and log back in to check the result in the file /var/log/user-
activity.log
[root@client ~]# cat /var/log/user-activity.log
Oct 7 00:18:20 ad root: root 192.168.124.1 [4927]: service
postfix stautus [2]
Oct 7 00:18:25 ad root: root 192.168.124.1 [4927]: service
postfix status [0]
Oct 7 00:19:10 ad root: root 192.168.124.1 [4991]: exit [0]
Oct 7 00:19:16 ad root: root 192.168.124.1 [4991]: service
postfix status [0]
Oct 7 00:19:23 ad root: root 192.168.124.1 [4991]: service
sendmail status [1]
Oct 7 00:20:05 ad root: root 192.168.124.1 [4991]: date [0]
Oct 7 00:20:06 ad root: root 192.168.124.1 [4991]: pwd [0]
Oct 7 00:20:10 ad root: root 192.168.124.1 [4991]: history
[0]
Oct 7 00:20:15 ad root: root 192.168.124.1 [4991]: service
named status [0]
Oct 7 00:20:21 ad root: root 192.168.124.1 [4991]: service
named restart [0]
Oct 7 00:20:49 ad root: root 192.168.124.1 [4991]: cp -v
/home/ahmed/* /root [0]
Oct 7 00:21:03 ad root: root 192.168.124.1 [4991]: ll [0]
Oct 7 00:21:16 ad root: root 192.168.124.1 [4991]: cat su [0]
Oct 7 00:21:31 ad root: ahmed 192.168.124.1 [5135]: exit [0]
Oct 7 00:21:32 ad root: ahmed 192.168.124.1 [5135]: redhat
[127]
Oct 7 00:21:35 ad root: ahmed 192.168.124.1 [5135]: who am i
[0]
Oct 7 00:21:38 ad root: ahmed 192.168.124.1 [5135]: ls [0]
Oct 7 00:21:46 ad root: ahmed 192.168.124.1 [5135]: rm * [0]
Oct 7 00:21:49 ad root: root 192.168.124.1 [4991]: su - ahmed
[0]
$ModLoad imtcp
$InputTCPServerRun 514
7) Restart the server and configure iptables to accept the rsyslog connections
[root@server ~]# service rsyslog restart
[root@server ~]# iptables -A INPUT -m state --state NEW -m tcp -
p tcp --dport 514 -j ACCEPT
[root@server ~]# iptables -A INPUT -m state --state NEW -m udp -
p udp --dport 514 -j ACCEPT
[root@server ~]# service iptables save
$ModLoad imtcp
$InputTCPServerRun 514
$AllowedSender TCP, 127.0.0.1, 192.168.124.0/24
local3.* @@192.168.124.250:514
10) Logoff and Log back in and run some commands that will be recorded on the
server at the defined location here it is /var/log/servers/clients.log
When running as an Active Directory DC, you only need to run 'samba' (not
smbd/nmbd/winbindd), as the required services are co-coordinated by this master
binary. The tool to administer the Active Directory services is called 'samba-tool'.
I have a CentOS 6 x86_64 Minimal install. This post covers the initial installation and
configuration of samba 4 as Active Directory domain controller on Centos 6 using BIND
9 as DNS backend and NTP server used by the clients.
1) Disable SELinux
[root@ad ~]# vi /etc/sysconfig/selinux
selinux=disabled
A DNS keytab file was automatically created during provisioning/updating. Add the
following' tkey-gssapi-keytab' option to the 'options' section of named.conf file.
[root@ad ~]# vim /etc/named.conf
options {
listen-on port 53 { 192.168.1.100; };
allow-query { any; };
tkey-gssapi-keytab "/usr/local/samba/private/dns.keytab";
};
include "/usr/local/samba/private/named.conf";
include "/etc/rndc.key";
if [ -f /etc/sysconfig/samba4 ]; then
. /etc/sysconfig/samba4
fi
CWD=$(pwd)
prog="samba4"
start() {
# Attach irda device
echo -n $"Starting $prog: "
/usr/local/samba/sbin/samba
sleep 2
if ps ax | grep -v "grep" | grep -q /samba/sbin/samba ; then
success $"samba4 startup"; else failure $"samba4 startup"; fi
echo
}
stop() {
# Stop service.
echo -n $"Shutting down $prog: "
killall samba
sleep 2
if ps ax | grep -v "grep" | grep -q /samba/sbin/samba ; then
failure $"samba4 shutdown"; else success $"samba4 shutdown"; fi
echo
}
status() {
/usr/local/samba/sbin/samba --show-build
}
10) Configure the services to start at boot and start the below services.
[root@ad ~]# chkconfig ntpd on
[root@ad ~]# chkconfig named on
[root@ad ~]# chkconfig samba4 on
[root@ad ~]# service ntpd start
[root@ad ~]# service named on
[root@ad ~]# service samba4 on
11) If iptables is enabled then the below ports need to allowed through firewall.
[root@ad ~]# iptables -A INPUT -p udp -i eth0 -s 192.168.1.0/24
--dport 53 -j ACCEPT
[root@ad ~]# iptables -A INPUT -p udp -i eth0 -s 192.168.1.0/24
--dport 123 -j ACCEPT
[root@ad ~]# iptables -A INPUT -p udp -i eth0 -s 192.168.1.0/24
--dport 135 -j ACCEPT
[root@ad ~]# iptables -A INPUT -p udp -i eth0 -s 192.168.1.0/24
--dport 138 -j ACCEPT
[root@ad ~]# iptables -A INPUT -p udp -i eth0 -s 192.168.1.0/24
--dport 389 -j ACCEPT
[root@ad ~]# iptables -A INPUT -p tcp -i eth0 -s 192.168.1.0/24
--dport 88 -j ACCEPT
[root@ad ~]# iptables -A INPUT -p tcp -i eth0 -s 192.168.1.0/24
--dport 139 -j ACCEPT
[root@ad ~]# iptables -A INPUT -p tcp -i eth0 -s 192.168.1.0/24
--dport 389 -j ACCEPT
[root@ad ~]# iptables -A INPUT -p tcp -i eth0 -s 192.168.1.0/24
--dport 445 -j ACCEPT
[root@ad ~]# iptables -A INPUT -p tcp -i eth0 -s 192.168.1.0/24
--dport 464 -j ACCEPT
[root@ad ~]# iptables -A INPUT -p tcp -i eth0 -s 192.168.1.0/24
--dport 636 -j ACCEPT
[root@ad ~]# iptables -A INPUT -p tcp -i eth0 -s 192.168.1.0/24
--dport 1024:1032 -j ACCEPT
[root@ad ~]# iptables -A INPUT -p tcp -i eth0 -s 192.168.1.0/24
--dport 3268 -j ACCEPT
[root@ad ~]# iptables -A INPUT -p udp -i eth0 -s 192.168.1.0/24
--dport 3269 -j ACCEPT
12) Reboot the system to check services are working after reboot are not.
[root@ad ~]# reboot
13) Join a Windows PC to this domain controller
14) Troubleshooting incase debugging dynamic DNS updates are not working
[root@ad ~]# /usr/local/samba/sbin/samba_dnsupdate --verbose --
all-names
Prerequisites:
1) Working Postfix / Sendmail (example.com domain I have taken)
2) Root account is needed to configure the below
Success.
5) Download the latest ZCS (Zimbra Collabaration Suite) from the website
[root@mail Desktop]# wget http://files2.zimbra.com/downloads/zcs-
8.0.3_GA_5664.RHEL6_64.20130305090204.tgz
Do you agree with the terms of the software license agreement? [N] y
Oracle Binary Code License Agreement for the Java SE Platform Products
ORACLE AMERICA, INC. ("ORACLE"), FOR AND ON BEHALF OF ITSELF AND ITS
SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL, IS WILLING TO LICENSE THE
SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE
TERMS CONTAINED IN THIS BINARY CODE LICENSE AGREEMENT AND SUPPLEMENTAL
LICENSE TERMS (COLLECTIVELY "AGREEMENT"). PLEASE READ THE AGREEMENT
CAREFULLY. BY SELECTING THE "ACCEPT LICENSE AGREEMENT" (OR THE EQUIVALENT)
BUTTON AND/OR BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ
THE TERMS AND AGREE TO THEM. IF YOU ARE AGREEING TO THESE TERMS ON BEHALF
OF A COMPANY OR OTHER LEGAL ENTITY, YOU REPRESENT THAT YOU HAVE THE
LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT
HAVE SUCH AUTHORITY, OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, THEN
SELECT THE "DECLINE LICENSE AGREEMENT" (OR THE EQUIVALENT) BUTTON AND YOU
MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE
SOFTWARE IS CONTAINED.
1. DEFINITIONS. "Software" means the Java SE Platform Products in binary form that
you selected for download, install or use from Oracle or its authorized licensees, any
other machine readable materials (including, but not limited to, libraries, source
files, header files, and data files), any updates or error corrections provided by
Oracle, and any user manuals, programming guides and other documentation provided
to you by Oracle under this Agreement. "General Purpose Desktop Computers and
Servers" means computers, including desktop and laptop computers, or servers, used
for general computing functions under end user control (such as but not specifically
limited to email, general purpose Internet browsing, and office suite productivity
tools). The use of Software in systems and solutions that provide dedicated
functionality (other than as mentioned above) or designed for use in embedded or
function-specific software applications, for example but not limited to: Software
embedded in or bundled with industrial control systems, wireless mobile telephones,
wireless handheld devices, netbooks, kiosks, TV/STB, Blu-ray Disc devices, telematics
and network control switching equipment, printers and storage management systems,
and other related systems are excluded from this definition and not licensed under
this Agreement. "Programs" means Java technology applets and applications
intended to run on the Java Platform, Standard Edition platform on Java-enabled
General Purpose Desktop Computers and Servers. ?Commercial Features? means those
features identified in Table 1-1 (Commercial Features In Java SE Product Editions) of
the Software documentation accessible at
http://www.oracle.com/technetwork/java/javase/documentation/index.html.
?README File? means the README file for the Software accessible at
http://www.oracle.com/technetwork/java/javase/terms/readme/index.html.
7. EXPORT REGULATIONS. You agree that U.S. export control laws and other
applicable export and import laws govern your use of the Software, including
technical data; additional information can be found on Oracle's Global Trade
Compliance web site (http://www.oracle.com/products/export). You agree that
neither the Software nor any direct product thereof will be exported, directly, or
indirectly, in violation of these laws, or will be used for any purpose prohibited by
these laws including, without limitation, nuclear, chemical, or biological weapons
proliferation.
10. GOVERNING LAW. This agreement is governed by the substantive and procedural
laws of California. You and Oracle agree to submit to the exclusive jurisdiction of,
and venue in, the courts of San Francisco, or Santa Clara counties in California in any
dispute arising out of or relating to this agreement.
12. INTEGRATION. This Agreement is the entire agreement between you and Oracle
relating to its subject matter. It supersedes all prior or contemporaneous oral or
written communications, proposals, representations and warranties and prevails over
any conflicting or additional terms of any quote, order, acknowledgment, or other
communication between the parties relating to its subject matter during the term of
this Agreement. No modification of this Agreement will be binding, unless in
writing and signed by an authorized representative of each party.
These Supplemental License Terms add to or modify the terms of the Binary Code
License Agreement. Capitalized terms not defined in these Supplemental Terms shall
have the same meanings ascribed to them in the Binary Code License Agreement.
These Supplemental Terms shall supersede any inconsistent or conflicting terms in
the Binary Code License Agreement, or in any license contained within the Software.
A. COMMERCIAL FEATURES. You may not use the Commercial Features for running
Programs, Java applets or applications in your internal business operations or for any
commercial or production purpose, or for any purpose other than as set forth in
Sections B, C, D and E of these Supplemental Terms. If You want to use the
Commercial Features for any purpose other than as permitted in this Agreement, You
must obtain a separate license from Oracle.
F. JAVA TECHNOLOGY RESTRICTIONS. You may not create, modify, or change the
behavior of, or authorize your licensees to create, modify, or change the behavior of,
classes, interfaces, or subpackages that are in any way identified as "java", "javax",
"sun", ?oracle? or similar convention as specified by Oracle in any naming convention
designation.
Use of the Commercial Features for any commercial or production purpose requires a
separate license from Oracle. ?Commercial Features? means those features identified
Table 1-1 (Commercial Features In Java SE Product Editions) of the Software
documentation accessible at
http://www.oracle.com/technetwork/java/javase/documentation/index.html
H. SOURCE CODE. Software may contain source code that, unless expressly licensed
for other purposes, is provided solely for reference purposes pursuant to the terms of
this Agreement. Source code may not be redistributed unless expressly provided for
in this Agreement.
I. THIRD PARTY CODE. Additional copyright notices and license terms applicable to
portions of the Software are set forth in the THIRDPARTYLICENSEREADME file
accessible at
http://www.oracle.com/technetwork/java/javase/documentation/index.html. In
addition to any terms and conditions of any third party opensource/freeware license
identified in the THIRDPARTYLICENSEREADME file, the disclaimer of warranty and
limitation of liability provisions in paragraphs 4 and 5 of the Binary Code License
Agreement shall apply to all Software in this distribution.
For inquiries please contact: Oracle America, Inc., 500 Oracle Parkway,
Redwood Shores, California 94065, USA.
Do you agree with the terms of the software license agreement? [N] y
Found zimbra-core
Found zimbra-ldap
Found zimbra-logger
Found zimbra-mta
Found zimbra-snmp
Found zimbra-store
Found zimbra-apache
Found zimbra-spell
Found zimbra-memcached
Found zimbra-proxy
Installing:
zimbra-core
zimbra-logger
zimbra-mta
zimbra-snmp
zimbra-store
zimbra-apache
zimbra-spell
Using packages for a platform in which they were not designed for
may result in an installation that is NOT usable. Your support
options may be limited if you choose to continue.
Removing /opt/zimbra
Removing zimbra crontab entry...done.
Cleaning up zimbra init scripts...done.
Cleaning up /etc/ld.so.conf...done.
Cleaning up /etc/security/limits.conf...done.
Installing packages
zimbra-core......zimbra-core-8.0.3_GA_5664.RHEL6_64-
20130305090204.x86_64.rpm...done
zimbra-logger......zimbra-logger-8.0.3_GA_5664.RHEL6_64-
20130305090204.x86_64.rpm...done
zimbra-mta......zimbra-mta-8.0.3_GA_5664.RHEL6_64-
20130305090204.x86_64.rpm...done
zimbra-snmp......zimbra-snmp-8.0.3_GA_5664.RHEL6_64-
20130305090204.x86_64.rpm...done
zimbra-store......zimbra-store-8.0.3_GA_5664.RHEL6_64-
20130305090204.x86_64.rpm...done
zimbra-apache......zimbra-apache-8.0.3_GA_5664.RHEL6_64-
20130305090204.x86_64.rpm...done
zimbra-spell......zimbra-spell-8.0.3_GA_5664.RHEL6_64-
20130305090204.x86_64.rpm...done
Operations logged to /tmp/zmsetup.04222013-050458.log
Setting defaults...done.
Checking for port conflicts
Port conflict detected: 25 (zimbra-mta)
Port conflict detected: 25 (zimbra-mta)
Port conflicts detected! - Press Enter/Return key to continue
Main menu
1) Common Configuration:
2) zimbra-ldap: Enabled
3) zimbra-store: Enabled
+Create Admin User: yes
+Admin user to create: admin@mail.example.com
******* +Admin Password UNSET
+Anti-virus quarantine user: virus-
quarantine.qmia5kvbre@mail.example.com
+Enable automated spam training: yes
+Spam training user: spam.ymhnphn3qm@mail.example.com
+Non-spam(Ham) training user: ham.tquoqaxih@mail.example.com
+SMTP host: mail.example.com
+Web server HTTP port: 80
+Web server HTTPS port: 443
+Web server mode: https
+IMAP server port: 143
+IMAP server SSL port: 993
+POP server port: 110
+POP server SSL port: 995
+Use spell check server: yes
+Spell server URL: http://mail.example.com:7780/aspell.php
+Configure for use with mail proxy: FALSE
+Configure for use with web proxy: FALSE
+Enable version update checks: TRUE
+Enable version update notifications: TRUE
+Version update notification email: admin@mail.example.com
+Version update source email: admin@mail.example.com
4) zimbra-mta: Enabled
5) zimbra-snmp: Enabled
6) zimbra-logger: Enabled
7) zimbra-spell: Enabled
8) Default Class of Service Configuration:
r) Start servers after configuration yes
s) Save config to file
x) Expand menu
q) Quit
Store configuration
1) Status: Enabled
2) Create Admin User: yes
3) Admin user to create: admin@mail.example.com
** 4) Admin Password UNSET
5) Anti-virus quarantine user: virus-
quarantine.qmia5kvbre@mail.example.com
6) Enable automated spam training: yes
7) Spam training user: spam.ymhnphn3qm@mail.example.com
8) Non-spam(Ham) training user: ham.tquoqaxih@mail.example.com
9) SMTP host: mail.example.com
10) Web server HTTP port: 80
11) Web server HTTPS port: 443
12) Web server mode: https
13) IMAP server port: 143
14) IMAP server SSL port: 993
15) POP server port: 110
16) POP server SSL port: 995
17) Use spell check server: yes
18) Spell server URL: http://mail.example.com:7780/aspell.php
19) Configure for use with mail proxy: FALSE
20) Configure for use with web proxy: FALSE
21) Enable version update checks: TRUE
22) Enable version update notifications: TRUE
23) Version update notification email: admin@mail.example.com
24) Version update source email: admin@mail.example.com
Select, or 'r' for previous menu [r] 3
Store configuration
1) Status: Enabled
2) Create Admin User: yes
3) Admin user to create: admin@example.com
4) Admin Password set
5) Anti-virus quarantine user: virus-
quarantine.qmia5kvbre@mail.example.com
6) Enable automated spam training: yes
7) Spam training user: spam.ymhnphn3qm@mail.example.com
8) Non-spam(Ham) training user: ham.tquoqaxih@mail.example.com
9) SMTP host: mail.example.com
10) Web server HTTP port: 80
11) Web server HTTPS port: 443
12) Web server mode: https
13) IMAP server port: 143
14) IMAP server SSL port: 993
15) POP server port: 110
16) POP server SSL port: 995
17) Use spell check server: yes
18) Spell server URL: http://mail.example.com:7780/aspell.php
19) Configure for use with mail proxy: FALSE
20) Configure for use with web proxy: FALSE
21) Enable version update checks: TRUE
22) Enable version update notifications: TRUE
23) Version update notification email: admin@mail.example.com
24) Version update source email: admin@mail.example.com
Store configuration
1) Status: Enabled
2) Create Admin User: yes
3) Admin user to create: admin@example.com
4) Admin Password set
5) Anti-virus quarantine user: av-quarantine@example.com
6) Enable automated spam training: yes
7) Spam training user: spam.ymhnphn3qm@mail.example.com
8) Non-spam(Ham) training user: ham.tquoqaxih@mail.example.com
9) SMTP host: mail.example.com
10) Web server HTTP port: 80
11) Web server HTTPS port: 443
12) Web server mode: https
13) IMAP server port: 143
14) IMAP server SSL port: 993
15) POP server port: 110
16) POP server SSL port: 995
17) Use spell check server: yes
18) Spell server URL: http://mail.example.com:7780/aspell.php
19) Configure for use with mail proxy: FALSE
20) Configure for use with web proxy: FALSE
21) Enable version update checks: TRUE
22) Enable version update notifications: TRUE
23) Version update notification email: admin@mail.example.com
24) Version update source email: admin@mail.example.com
Store configuration
1) Status: Enabled
2) Create Admin User: yes
3) Admin user to create: admin@example.com
4) Admin Password set
5) Anti-virus quarantine user: av-quarantine@example.com
6) Enable automated spam training: yes
7) Spam training user: spam@example.com
8) Non-spam(Ham) training user: ham.tquoqaxih@mail.example.com
9) SMTP host: mail.example.com
10) Web server HTTP port: 80
11) Web server HTTPS port: 443
12) Web server mode: https
13) IMAP server port: 143
14) IMAP server SSL port: 993
15) POP server port: 110
16) POP server SSL port: 995
17) Use spell check server: yes
18) Spell server URL: http://mail.example.com:7780/aspell.php
19) Configure for use with mail proxy: FALSE
20) Configure for use with web proxy: FALSE
21) Enable version update checks: TRUE
22) Enable version update notifications: TRUE
23) Version update notification email: admin@mail.example.com
24) Version update source email: admin@mail.example.com
Store configuration
1) Status: Enabled
2) Create Admin User: yes
3) Admin user to create: admin@example.com
4) Admin Password set
5) Anti-virus quarantine user: av-quarantine@example.com
6) Enable automated spam training: yes
7) Spam training user: spam@example.com
8) Non-spam(Ham) training user: ham@example.com
9) SMTP host: mail.example.com
10) Web server HTTP port: 80
11) Web server HTTPS port: 443
12) Web server mode: https
13) IMAP server port: 143
14) IMAP server SSL port: 993
15) POP server port: 110
16) POP server SSL port: 995
17) Use spell check server: yes
18) Spell server URL: http://mail.example.com:7780/aspell.php
19) Configure for use with mail proxy: FALSE
20) Configure for use with web proxy: FALSE
21) Enable version update checks: TRUE
22) Enable version update notifications: TRUE
23) Version update notification email: admin@mail.example.com
24) Version update source email: admin@mail.example.com
Store configuration
1) Status: Enabled
2) Create Admin User: yes
3) Admin user to create: admin@example.com
4) Admin Password set
5) Anti-virus quarantine user: av-quarantine@example.com
6) Enable automated spam training: yes
7) Spam training user: spam@example.com
8) Non-spam(Ham) training user: ham@example.com
9) SMTP host: mail.example.com
10) Web server HTTP port: 80
11) Web server HTTPS port: 443
12) Web server mode: https
13) IMAP server port: 143
14) IMAP server SSL port: 993
15) POP server port: 110
16) POP server SSL port: 995
17) Use spell check server: yes
18) Spell server URL: http://mail.example.com:7780/aspell.php
19) Configure for use with mail proxy: FALSE
20) Configure for use with web proxy: FALSE
21) Enable version update checks: TRUE
22) Enable version update notifications: TRUE
23) Version update notification email: admin@example.com
24) Version update source email: admin@mail.example.com
Store configuration
1) Status: Enabled
2) Create Admin User: yes
3) Admin user to create: admin@example.com
4) Admin Password set
5) Anti-virus quarantine user: av-quarantine@example.com
6) Enable automated spam training: yes
7) Spam training user: spam@example.com
8) Non-spam(Ham) training user: ham@example.com
9) SMTP host: mail.example.com
10) Web server HTTP port: 80
11) Web server HTTPS port: 443
12) Web server mode: https
13) IMAP server port: 143
14) IMAP server SSL port: 993
15) POP server port: 110
16) POP server SSL port: 995
17) Use spell check server: yes
18) Spell server URL: http://mail.example.com:7780/aspell.php
19) Configure for use with mail proxy: FALSE
20) Configure for use with web proxy: FALSE
21) Enable version update checks: TRUE
22) Enable version update notifications: TRUE
23) Version update notification email: admin@example.com
24) Version update source email: admin@example.com
Main menu
1) Common Configuration:
2) zimbra-ldap: Enabled
3) zimbra-store: Enabled
4) zimbra-mta: Enabled
5) zimbra-snmp: Enabled
6) zimbra-logger: Enabled
7) zimbra-spell: Enabled
8) Default Class of Service Configuration:
r) Start servers after configuration yes
s) Save config to file
x) Expand menu
q) Quit
Common configuration
1) Hostname: mail.example.com
2) Ldap master host: mail.example.com
3) Ldap port: 389
4) Ldap Admin password: set
5) Secure interprocess communications: yes
6) TimeZone: Asia/Colombo
7) IP Mode: ipv4
1 Africa/Algiers
2 Africa/Cairo
3 Africa/Casablanca
4 Africa/Harare
5 Africa/Monrovia
6 Africa/Nairobi
7 Africa/Windhoek
8 America/Anchorage
9 America/Argentina/Buenos_Aires
10 America/Asuncion
11 America/Bogota
12 America/Caracas
13 America/Cayenne
14 America/Chicago
15 America/Chihuahua
16 America/Cuiaba
17 America/Denver
18 America/Godthab
19 America/Guatemala
20 America/Guyana
21 America/Halifax
22 America/Indiana/Indianapolis
23 America/Los_Angeles
24 America/Mexico_City
25 America/Montevideo
26 America/New_York
27 America/Phoenix
28 America/Regina
29 America/Santiago
30 America/Sao_Paulo
31 America/St_Johns
32 America/Tijuana
33 Asia/Almaty
34 Asia/Amman
35 Asia/Baghdad
36 Asia/Baku
37 Asia/Bangkok
38 Asia/Beirut
39 Asia/Colombo
40 Asia/Damascus
41 Asia/Dhaka
42 Asia/Hong_Kong
43 Asia/Irkutsk
44 Asia/Jerusalem
45 Asia/Kabul
46 Asia/Karachi
47 Asia/Kolkata
48 Asia/Krasnoyarsk
49 Asia/Kuala_Lumpur
50 Asia/Kuwait
51 Asia/Magadan
52 Asia/Muscat
53 Asia/Novosibirsk
54 Asia/Rangoon
55 Asia/Seoul
56 Asia/Taipei
57 Asia/Tashkent
58 Asia/Tbilisi
59 Asia/Tehran
60 Asia/Tokyo
61 Asia/Ulaanbaatar
62 Asia/Vladivostok
63 Asia/Yakutsk
64 Asia/Yekaterinburg
65 Asia/Yerevan
66 Atlantic/Azores
67 Atlantic/Cape_Verde
68 Atlantic/South_Georgia
69 Australia/Adelaide
70 Australia/Brisbane
71 Australia/Darwin
72 Australia/Hobart
73 Australia/Perth
74 Australia/Sydney
75 Etc/GMT+12
76 Europe/Athens
77 Europe/Belgrade
78 Europe/Berlin
79 Europe/Brussels
80 Europe/Helsinki
81 Europe/Istanbul
82 Europe/Kaliningrad
83 Europe/London
84 Europe/Minsk
85 Europe/Moscow
86 Europe/Warsaw
87 Indian/Mauritius
88 Pacific/Auckland
89 Pacific/Fiji
90 Pacific/Guadalcanal
91 Pacific/Guam
92 Pacific/Honolulu
93 Pacific/Midway
94 Pacific/Tongatapu
95 UTC
Enter the number for the local timezone: [39] 47
Common configuration
1) Hostname: mail.example.com
2) Ldap master host: mail.example.com
3) Ldap port: 389
4) Ldap Admin password: set
5) Secure interprocess communications: yes
6) TimeZone: Asia/Kolkata
7) IP Mode: ipv4
Common configuration
1) Hostname: mail.example.com
2) Ldap master host: mail.example.com
3) Ldap port: 389
4) Ldap Admin password: set
5) Secure interprocess communications: yes
6) TimeZone: Asia/Kolkata
7) IP Mode: ipv4
Main menu
1) Common Configuration:
2) zimbra-ldap: Enabled
3) zimbra-store: Enabled
4) zimbra-mta: Enabled
5) zimbra-snmp: Enabled
6) zimbra-logger: Enabled
7) zimbra-spell: Enabled
8) Default Class of Service Configuration:
r) Start servers after configuration yes
s) Save config to file
x) Expand menu
q) Quit
8) Log back again as zimbra user and start the zimbra services
[root@mail Desktop]# su zimbra
[zimbra@mail Desktop]# sudo chown -R zimbra:zimbra
/opt/zimbra/zimbramon/crontabs
[zimbra@mail Desktop]# cd /opt/zimbra/zimbramon/crontabs/
[zimbra@mail Desktop]# cat crontab >> crontab.zimbra
[zimbra@mail Desktop]# cat crontab.ldap >> crontab.zimbra
[zimbra@mail Desktop]# cat crontab.logger >> crontab.zimbra
[zimbra@mail Desktop]# cat crontab.mta >> crontab.zimbra
[zimbra@mail Desktop]# cat crontab.store >> crontab.zimbra
[zimbra@mail Desktop]# crontab crontab.zimbra
[zimbra@mail Desktop]# crontab -l
[zimbra@mail Desktop]# zmcontrol start
[zimbra@mail Desktop]# zmcontrol status
[zimbra@mail Desktop]# exit
To install the kernel first download the latest stable kernel package from the
following website.
http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.4.7.tar.bz2
Note: At the time of writing this article, this is the latest and stable package
available, please make sure you download the latest stable version by visiting this
website http://www.kernel.org
Install the dependency packages that are needed to compile the kernel.
[root@server ~] # yum install gcc ncurses-devel -y
Note: It will make sure that your old configuration will still be available
Note: Running this command will take a long time to compile modules and drivers
etc. Depending on the speed of your system, it may take more that an hour, be
patient.
Note: This command will automatically create the following files in /boot directory.
System.map-3.4.7
vmlinuz-3.4.7
initramfs-3.4.7.img
Also it will make an entry in the grub.conf regarding the new kernel information.
Make sure to the system will boot with the newly installed kernel as default one.
[root@server linux-3.4.7] # vim /etc/grub.conf
default=0
Incase there is any problem, you can always revert back to the old kernel.
Now verify the java version, it should now point out to the new version.
Create a Tomcat system user account responsible for running tomcat as running it
with root is not a good practice and it will create a entry to break into the system.
[root@server java] # useradd -r tomcat
Download the tomcat package from the apache tomcat website using the following
link
http://apache.petsads.us/tomcat/tomcat-7/v7.0.40/bin/apache-tomcat-
7.0.40.tar.gz
After downloading the package copy the package to the /usr/local directory.
[root@server java] # cd /root/Downloads
#!/bin/bash
#
# tomcat Starts Tomcat Java server.
#
#
# chkconfig: 345 88 12
# description: Tomcat is the server for
# Java servlet applications.
### BEGIN INIT INFO
# Provides: $tomcat
### END INIT INFO
JAVA_HOME=/usr/java/jdk1.6.0_25
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH
TOMCAT_HOME=/usr/local/apache-tomcat7
START_TOMCAT=/usr/local/tomcat7/bin/startup.sh
STOP_TOMCAT=/usr/local/tomcat7/bin/shutdown.sh
[ -f $START_TOMCAT ] || exit 0
[ -f $STOP_TOMCAT ] || exit 0
RETVAL=0
umask 077
start() {
echo -n $"Starting Tomcat Java server: "
daemon su -c $START_TOMCAT tomcat
echo
return $RETVAL
}
stop() {
echo -n $"Shutting down Tomcat Java server: "
daemon su -c $STOP_TOMCAT tomcat
echo
return $RETVAL
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
restart
;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
esac
exit $?
Test the script by starting, stopping and restarting the tomcat service.
[root@server init.d] # service tomcat start
If you dont have any errors then you can proceed further, or else rectify it first.
Then you should be able to view the below screen like this
For this demo, I'm using a CentOS 5.5 machine to configure PXE Server
Server IP: 192.168.1.1
Server Name : server.example.com
# cp -r /media/CentOS_5.5_Final/* /var/www/html/centos/
# vim /etc/yum.repos.d/centos.repo
[centos]
name=CentOS 5.5 Repository
baseurl=file:///var/www/html/centos
gpgcheck=0
enabled=1
# yum repolist
Configure the answer file use the default anaconda-ks.cfg as base and configure
according to your requirement
# cp /root/anaconda-ks.cfg /var/www/html/centos/ks.cfg
# vim /etc/dhcp/dhcpd.conf
authoritative;
subnet 192.168.1.0 netmask 255.255.255.0 {
option subnet-mask 255.255.255.0;
option domain-name "example.com";
range dynamic-bootp 192.168.1.225 192.168.1.254;
default-lease-time 600;
max-lease-time 7200;
### PXE Server IP Address ###
next-server 192.168.1.1;
filename "pxelinux.0";
}
# chkconfig dhcpd on
# mkdir -p /tftpboot/{images,pxelinux.cfg}
# cp /var/www/html/centos/images/pxeboot/vmlinuz /tftpboot/images
# cp /var/www/html/centos/images/pxeboot/initrd.img /tftpboot/images
# vim /etc/xinetd.d/tftp
server_args = -s /tftpboot
disable = no
# chkconfig tftp on
# cp /usr/lib/syslinux/menu.c32 /tftpboot/
# cp /usr/lib/syslinux/pxelinux.0 /tftpboot/
# vim /tftpboot/pxelinux.cfg/default
default menu.c32
prompt 0
timeout 100
MENU TITLE Operating System Selection
LABEL CentOS 5.5 x86 Edition
MENU LABEL CentOS 5.5 x86 Editon
KERNEL images/vmlinuz
append initrd=images/initrd.img linux ks=http://192.168.1.1/centos/ks.cfg
# system-config-securitylevel
Click on other ports and add 67 UDP for DHCP, 69 UDP for TFTP and also 80 TCP for
Web Server to trusted ports.
Client IP : 192.168.1.101
Server Name : client.example.com
Create an LVM for presenting the disk to the clients. The reason why choose LVM is
because the disk can be extended incase we need to without disrupting the services,
i.e. online extending of disk can be done with LVM.
Creating a LVM:
# fdisk /dev/sda
# partprobe /dev/sda
Check whether the newly created partition is read by the kernel are not.
# cat /proc/partitions
# pvcreate /dev/sda5
# pvdisplay
# lvdisplay /dev/myvolgrp/mylogvol
Now we will configure the iSCSI Target for presenting this LVM to the clients. At the
end of the file type the below configuration.
# vim /etc/tgt/targets.conf
<target iqn.2012.07.com.example:server.target1>
backing-store /dev/myvolgrp/mylogvol
</target>
If firewall is enabled, make sure 3260 and 860 both TCP & UDP ports are allowed
through the firewall.
Start the iscsi daemon and make sure service is available even after restart.
# service iscsi start && chkconfig iscsi on
From the output of the previous command we know the SCSI disk is /dev/sdb and its
of 2GB in size, now lets create a partition and mount it
# fdisk /dev/sdb
# partprobe /dev/sdb
Create a EXT3 partition of the newly created partition and mount it on /data.
# mkdir /data
# mkfs.ext3 /dev/sdb1
# vim /etc/fstab
/dev/sdb1 /data ext3 defaults 0 0
Piranha offers the facility for load balancing inward IP network traffics (requests) and
distribution of this IP traffic among a farm of server machines. The technique that is
used to load balance IP network traffic is based on Linux Virtual Server tools.
This High Availability is purely software based provided by Piranha. Piranha also
facilitates system administrator with a cool Graphical User Interface tool for
management.
IPVS kernel, LVS (manage the IPVS routing table via the ipvsadm tool)
Nanny (monitor servers & services on real servers in a cluster)
Pulse (control the other daemons and handle failovers between IPVS routing
boxes).
First of all stop all the services that we dont need to run on the nodes.
[root@websrv1 ~]# service bluetooth stop && chkconfig level 235 bluetooth off
[root@websrv1 ~]# service sendmail stop && chkconfig level 235 sendmail off
We will modify our hosts configuration file at /etc/hosts on each of the nodes in our
setup
After copying to host file to all the nodes, we need to generate SSH keys.
[root@websrv1 ~]# ssh-keygen t rsa
[root@websrv1 ~]# ssh-keygen t dsa
[root@websrv1 ~]# cd /root/.ssh/
[root@websrv1 .ssh]# cat *.pub > authorized_keys
Now copy ssh keys to all other nodes for password less entry which is required by
pulse daemon.
[root@websrv1 .ssh]# scp -r /root/.ssh/ websrv2:/root/
[root@websrv1 .ssh]# scp -r /root/.ssh/ lbnode1:/root/
[root@websrv1 .ssh]# scp -r /root/.ssh/ lbnode2:/root/
Now we will configure NTP service on all the nodes. We will make the LBNODE1 as our
NTP Server.
[root@lbnode1 ~]# rpm -qa | grep ntp
ntp-4.3.3p1-9.el5.centos
chkfontpath-1.20.1-1.1
Copy the same configuration or the file /etc/ntp.conf to other 2 nodes websrv2,
lbnode2. After copying restart the ntp service on these nodes.
Now we will update the time on all the nodes by typing following command:
[root@werbsrv2 ~]# ntpdate -u 192.168.1.1
[root@lbnode2 ~]# ntpdate -u 192.168.1.1
Now we will setup our Linux Virtual Server (LBNODE1 & LBNODE2) by installing Piranha
package. We already know that Piranha includes ipvsadm, nanny and pulse demon.
We will use Yum to install Piranha on the both nodes.
[root@lbnode1 ~]# yum install piranha -y
[root@lbnode2 ~]# yum install piranha -y
Now we will install and configure our web servers and arptables_jf package for direct
routing.
[root@websrv1 ~]# yum install httpd arptables_jf -y
[root@websrv1 ~]# echo "Web Server 1" > /var/www/html/index.html
Now we will configure the Ethernet interfaces for virtual IP on first web server node.
[root@websrv1 ~]# ifconfig eth0:1 192.168.1.150 netmask 255.255.255.0 broadcast
192.168.1.255 up
[root@websrv1 ]# echo ifconfig eth0:1 192.168.1.150 netmask 255.255.255.0
broadcast 192.168.1.255 up >> /etc/rc.local
Now we will configure the Ethernet interfaces for virtual IP on second web server
node.
[root@websrv2 ~]# ifconfig eth0:1 192.168.1.150 netmask 255.255.255.0 broadcast
192.168.1.255 up
[root@websrv2 ~]# echo ifconfig eth0:1 192.168.1.150 netmask 255.255.255.0
broadcast 192.168.1.255 up >> /etc/rc.local
Now we will configure our arptables on our first web server node.
[root@websrv1 ~]# arptables -A IN -d 192.168.1.150 -j DROP
[root@websrv1 ~]# arptables -A OUT -d 192.168.1.150 -j mangle --mangle-ip-s
192.168.1.1
[root@websrv1 ~]# arptables -A OUT -d 192.168.1.150 -j mangle --mangle-ip-s
192.168.1.2
[root@websrv1 ~]# service arptables_jf save
[root@websrv1 ~]# chkconfig arptables_jf on
Now we will configure our arptables on our first web server node.
[root@websrv2 ~]# arptables -A IN -d 192.168.1.150 -j DROP
[root@websrv2 ~]# arptables -A OUT -d 192.168.1.150 -j mangle --mangle-ip-s
192.168.1.1
[root@websrv2 ~]# arptables -A OUT -d 192.168.1.150 -j mangle --mangle-ip-s
192.168.1.2
[root@websrv2 ~]# service arptables_jf save
[root@websrv2 ~]# chkconfig arptables_jf on
We have managed to setup our LVS and webserver nodes now its time to test if
everything is working or not.
[root@lbnode01 ]# ipvsadm -L
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP www.orange.com:http rr
-> websrv1.orange.com:http Route 1 0 0
-> websrv2.orange.com:http Route 1 0 0
Finally open a web browser from any machine and type http://www.orange.com and
keep on refreshing the page, we will get output of page contents from Webserver 1
and Web Server 2.
//
// Sample named.conf BIND DNS server 'named' configuration file
// for the Red Hat BIND distribution.
//
// See the BIND Administrator's Reference Manual (ARM) for details, in:
// file:///usr/share/doc/bind-*/arm/Bv9ARM.html
// Also see the BIND Configuration GUI : /usr/bin/system-config-bind and
// its manual.
//
options
{
// Those options should be used carefully because they disable port
// randomization
// query-source port 53;
// query-source-v6 port 53;
};
logging
{
/* If you want to enable debugging, eg. using the 'rndc trace' command,
* named will try to write the 'named.run' file in the $directory (/var/named).
* By default, SELinux policy does not allow named to modify the /var/named directory,
* so put the default debug log file in data/ :
*/
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
//
// All BIND 9 zones are in a "view", which allow different zones to be served
// to different types of client addresses, and for options to be set for groups
// of zones.
//
// By default, if named.conf contains no "view" clauses, all zones are in the
// "default" view, which matches all clients.
//
// If named.conf contains any "view" clause, then all zones MUST be in a view;
// so it is recommended to start off using views to avoid having to restructure
// your configuration files in the future.
//
include "/etc/named.rfc1912.zones";
// all views must contain the root hints zone:
include "/etc/named.root.hints";
// include "named.rfc1912.zones";
// you should not serve your rfc1912 names to non-localhost clients.
// These are your "authoritative" internal zones, and would probably
// also be included in the "localhost_resolver" view above :
zone "dynamite.com" IN {
type master;
file "dynamite.com.fz";
};
zone "1.168.192.in-addr.arpa" IN {
type master;
file "dynamite.com.rz";
};
$TTL 86400
@ IN SOA dns.dynamite.com. dnsadmin.dynamite.com. (
2111201101 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
@ IN NS dns.dynamite.com.
dns IN A 192.168.1.1
www IN CNAME dns
sambaldap IN A 192.168.1.2
winxp IN A 192.168.1.3
$TTL 86400
@ IN SOA dns.dynamite.com. dnsadmin.dynamite.com. (
2111201101 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS dns.dynamite.com.
1 IN PTR dns
2 IN PTR sambaldap
3 IN PTR winxp
Name: dns.dynamite.com
Address: 192.168.1.1
Name: sambaldap.dynamite.com
Address: 192.168.1.2
> www.dynamite.com
Server: 192.168.1.1
Address: 192.168.1.1#53
www.dynamite.com canonical name = dns.dynamite.com.
Name: dns.dynamite.com
Address: 192.168.1.1
> exit
[root@sambaldap ~]# yum install openldap* compat-db python-ldap php-ldap ldapjdk nss_ldap samba
samba-common samba-client perl-Crypt-SmbHash perl-Digest-SHA1 perl-Jcode perl-Unicode-Map perl-
Unicode-Map8 perl-Unicode-MapUTF8 perl-Unicode-String smbldap-tools -y
#######################################################################
## Attributes used by Samba 3.0 schema ##
#######################################################################
##
## Password hashes
##
attributetype ( 1.3.6.1.4.1.7165.2.1.24 NAME 'sambaLMPassword'
DESC 'LanManager Password'
EQUALITY caseIgnoreIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{32} SINGLE-VALUE )
##
## Account flags in string format ([UWDX ])
##
attributetype ( 1.3.6.1.4.1.7165.2.1.26 NAME 'sambaAcctFlags'
DESC 'Account Flags'
EQUALITY caseIgnoreIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{16} SINGLE-VALUE )
##
## Password timestamps & policies
##
attributetype ( 1.3.6.1.4.1.7165.2.1.27 NAME 'sambaPwdLastSet'
DESC 'Timestamp of the last password update'
EQUALITY integerMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
##
## string settings
##
attributetype ( 1.3.6.1.4.1.7165.2.1.33 NAME 'sambaHomeDrive'
DESC 'Driver letter of home directory mapping'
EQUALITY caseIgnoreIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{4} SINGLE-VALUE )
##
## SID, of any type
##
##
## Primary group SID, compatible with ntSid
##
##
## group mapping attributes
##
attributetype ( 1.3.6.1.4.1.7165.2.1.19 NAME 'sambaGroupType'
DESC 'NT Group Type'
EQUALITY integerMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
##
## Store info on the domain
##
# "password history"
attributetype ( 1.3.6.1.4.1.7165.2.1.59 NAME 'sambaPwdHistoryLength'
DESC 'Length of Password History Entries (default: 0 => off)'
EQUALITY integerMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
# "lockout duration"
attributetype ( 1.3.6.1.4.1.7165.2.1.63 NAME 'sambaLockoutDuration'
DESC 'Lockout duration in minutes (default: 30, -1 => forever)'
EQUALITY integerMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
# "disconnect time"
attributetype ( 1.3.6.1.4.1.7165.2.1.66 NAME 'sambaForceLogoff'
DESC 'Disconnect Users outside logon hours (default: -1 => off, 0 => on)'
EQUALITY integerMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
#######################################################################
## objectClasses used by Samba 3.0 schema ##
#######################################################################
## The X.500 data model (and therefore LDAPv3) says that each entry can
## only have one structural objectclass. OpenLDAP 2.0 does not enforce
## this currently but will in v2.1
##
## added new objectclass (and OID) for 3.0 to help us deal with backwards
## compatibility with 2.2 installations (e.g. ldapsam_compat) --jerry
##
objectclass ( 1.3.6.1.4.1.7165.2.2.6 NAME 'sambaSamAccount' SUP top AUXILIARY
DESC 'Samba 3.0 Auxilary SAM Account'
MUST ( uid $ sambaSID )
MAY ( cn $ sambaLMPassword $ sambaNTPassword $ sambaPwdLastSet $
sambaLogonTime $ sambaLogoffTime $ sambaKickoffTime $
sambaPwdCanChange $ sambaPwdMustChange $ sambaAcctFlags $
displayName $ sambaHomePath $ sambaHomeDrive $ sambaLogonScript $
sambaProfilePath $ description $ sambaUserWorkstations $
sambaPrimaryGroupSID $ sambaDomainName $ sambaMungedDial $
sambaBadPasswordCount $ sambaBadPasswordTime $
sambaPasswordHistory $ sambaLogonHours) )
##
## Group mapping info
##
objectclass ( 1.3.6.1.4.1.7165.2.2.4 NAME 'sambaGroupMapping' SUP top AUXILIARY
DESC 'Samba Group Mapping'
MUST ( gidNumber $ sambaSID $ sambaGroupType )
MAY ( displayName $ description $ sambaSIDList ) )
##
## Trust password for trust relationships (any kind)
##
objectclass ( 1.3.6.1.4.1.7165.2.2.14 NAME 'sambaTrustPassword' SUP top STRUCTURAL
DESC 'Samba Trust Password'
MUST ( sambaDomainName $ sambaNTPassword $ sambaTrustFlags )
MAY ( sambaSID $ sambaPwdLastSet ) )
##
## Whole-of-domain info
##
objectclass ( 1.3.6.1.4.1.7165.2.2.5 NAME 'sambaDomain' SUP top STRUCTURAL
DESC 'Samba Domain Information'
MUST ( sambaDomainName $ sambaSID )
MAY ( sambaNextRid $ sambaNextGroupRid $ sambaNextUserRid $
sambaAlgorithmicRidBase $
sambaMinPwdLength $ sambaPwdHistoryLength $ sambaLogonToChgPwd $
sambaMaxPwdAge $ sambaMinPwdAge $
sambaLockoutDuration $ sambaLockoutObservationWindow $
sambaLockoutThreshold $
sambaForceLogoff $ sambaRefuseMachinePwdChange ) )
##
## used for idmap_ldap module
##
objectclass ( 1.3.6.1.4.1.7165.2.2.7 NAME 'sambaUnixIdPool' SUP top AUXILIARY
DESC 'Pool for allocating UNIX uids/gids'
MUST ( uidNumber $ gidNumber ) )
include /etc/openldap/schema/core.schema
include /etc/openldap/schema/cosine.schema
include /etc/openldap/schema/inetorgperson.schema
include /etc/openldap/schema/nis.schema
include /etc/openldap/schema/samba.schema
loglevel -1
pidfile /var/run/openldap/slapd.pid
argsfile /var/run/openldap/slapd.args
#######################################################################
# ldbm and/or bdb database definitions
#######################################################################
database bdb
suffix "dc=dynamite,dc=com"
rootdn "cn=Manager,dc=dynamite,dc=com"
rootpw redhat
# rootpw {crypt}ijFYNcSNctBYg
directory /var/lib/ldap
access to *
by self read
by * none
#
# LDAP Defaults
#
#SIZELIMIT 12
#TIMELIMIT 15
#DEREF never
ssl no
tls_cacertdir /etc/openldap/cacerts
pam_password md5
[global]
workgroup = dynamite.com
netbios name = DYNAMITE
enable privileges = yes
#interfaces = 192.168.1.131
username map = /etc/samba/smbusers
log level = 0
syslog = 0
log file = /var/log/samba/log.%m
max log size = 100000
#time server = Yes
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
mangling method = hash2
Dos charset = 850
Unix charset = ISO8859-1
[homes]
comment = Home Directories
valid users = %U
read only = No
create mask = 0664
directory mask = 0775
browseable = No
[profiles]
path = /home/samba/profiles
read only = No
create mask = 0600
directory mask = 0700
browseable = No
guest ok = Yes
profile acls = Yes
csc policy = disable
force user = %U
valid users = %U @"Domain Admins"
[netlogon]
path = /home/samba/netlogon/
browseable = No
read only = yes
# Purpose :
# . be the configuration file for all smbldap-tools scripts
##############################################################################
#
# General Configuration
#
##############################################################################
# Put your own SID. To obtain this number do: "net getlocalsid".
# If not defined, parameter is taking from "net getlocalsid" return
SID="S-1-5-21-3845255333-1124560154-2737011584"
##############################################################################
#
# LDAP Configuration
#
##############################################################################
# Notes: to use to dual ldap servers backend for Samba, you must patch
# Samba with the dual-head patch from IDEALX. If not using this patch
# just use the same server for slaveLDAP and masterLDAP.
# Those two servers declarations can also be used when you have
# . one master LDAP server where all writing operations must be done
# . one slave LDAP server where all reading operations must be done
# (typically a replication directory)
# CA certificate
# see "man Net::LDAP" in start_tls section for more details
#cafile="/etc/smbldap-tools/ca.pem"
# LDAP Suffix
# Ex: suffix=dc=IDEALX,dc=ORG
suffix="dc=dynamite,dc=com"
# Where are stored Idmap entries (used if samba is a domain member server)
# Ex: groupsdn="ou=Idmap,dc=IDEALX,dc=ORG"
# Warning: if 'suffix' is not set here, you must set the full dn for idmapdn
idmapdn="ou=Idmap,${suffix}"
# Where to store next uidNumber and gidNumber available for new users and groups
# If not defined, entries are stored in sambaDomainName object.
# Ex: sambaUnixIdPooldn="sambaDomainName=${sambaDomain},${suffix}"
# Ex: sambaUnixIdPooldn="cn=NextFreeUnixId,${suffix}"
sambaUnixIdPooldn="sambaDomainName=${sambaDomain},${suffix}"
##############################################################################
#
# Unix Accounts Configuration
#
##############################################################################
# Login defs
# Default Login Shell
# Ex: userLoginShell="/bin/bash"
userLoginShell="/bin/bash"
# Home directory
# Ex: userHome="/home/%U"
userHome="/home/%U"
# Default mode used for user homeDirectory
userHomeDirectoryMode="700"
# Gecos
userGecos="System User"
# Skel dir
skeletonDir="/etc/skel"
# Default password validation time (time in days) Comment the next line if
# you don't want password to be enable for defaultMaxPasswordAge days (be
# careful to the sambaPwdMustChange attribute's value)
defaultMaxPasswordAge="45"
##############################################################################
#
# SAMBA Configuration
#
##############################################################################
##############################################################################
#
# SMBLDAP-TOOLS Configuration (default are ok for a RedHat)
#
##############################################################################
# comment out the following line to get rid of the default banner
# no_banner="1"
dn: ou=DSA,dc=example,dc=com
objectClass: top
objectClass: organizationalUnit
ou: DSA
description: Security Accounts For LDAP Clients
dn: cn=samba,ou=DSA,dc=example,dc=com
objectclass: organizationalRole
objectClass: top
objectClass: simpleSecurityObject
userPassword: sambasecretpwd
cn: samba
dn: cn=nssldap,ou=DSA,dc=example,dc=com
objectclass: organizationalRole
objectClass: top
objectClass: simpleSecurityObject
userPassword: nssldapsecretpwd
cn: nssldap
dn: cn=smbtools,ou=DSA,dc=example,dc=com
objectclass: organizationalRole
objectClass: top
objectClass: simpleSecurityObject
userPassword: smbtoolssecretpwd
cn: smbtools
Note : Whenever an account is created with smbldap tools in LDAP, the same account must also be
created in local accounts database i.e. /etc/passwd
On Windows XP Machine Right Click My Computer -> Properties -> Select Computer Name tab -> Click
Change -> Select input computer name and select Domain and input dynamite.com -> Click OK ->
Provide the domain account credentials
i.e. (UserName: root & Password: abc123)
Login with the other user accounts into DYNAMITE.COM domain and confirm that they are able to
access the network resources.
# vim /etc/sudoers
Under the command Allow root to execute any command any where type the
following
# su - nagoor
# sudo /sbin/fdisk -l
(Command will prompt to enter password for nagoor user, then after specifying the
password the output will be displayed on the standard output)
# vim /etc/ssh/sshd_config
Port 2299
(Change the standard port number of SSH to your required port number and make
sure the firewall is permitted to allow 2299 port here in my example)
Protocol 2
(Make sure that protocol 2 is only permitted because it is more secure than protocol
1)
ListenAddress 192.168.1.1
(Here if you have multiple NIC's make sure that on which interface the server will
listen to SSH requets)
PermitRootLogin No
(Use this setting to block root user to use SSH for logging onto server)
# history (In the output you will find date & time before the command that is executed)
To make this persistent,
# export HISTTIMEFORMAT='%F %T ' >> /etc/profile
How to ignore some commands in history (not let history to record the
commands we execute)
# export HISTIGNORE=ignorespace
Type some commands like ls -l, date, time, who, etc., then type fdisk -l with a leading space
in the front before pressing enter. (Ex. # fdisk -l)
# history (In the output you will find fdisk command is not recorded in history file)
How to ignore duplicate commands in history (not let history to record the
duplicate of the commands we execute) (not recommended in production)
# export HISTIGNORE=ignoredups
Type the command cal 5 times continuously then execute history command
# history (In the output you will find cal command is recorded only once in history file,
because we are ignoring the duplicate entries)
How to set limitations for history file size and number of commands to
record
# export HISTSIZE=100 (Only 100 last commands of the current session would be
recorded)
View comments
1.
Awesome one
Reply
2.
hi..Im college student, this article is very informative, thanks for sharing :)
Reply
Loading
# vim /etc/named.conf
listen-on port 53 { 192.168.1.1; };
allow-query { any; };
go to the end of file and type the below configuration
zone "dynamite.com" IN {
type master;
file "dynamite.com";
allow-update { none; };
};
zone "1.168.192.in-addr.arpa" IN {
type master;
file "dynamite.com.rz";
allow-update { none; };
};
Save and exit the file
# cd /var/named
# vim dynamite.com
$TTL 1D
@ IN SOA dynamite.com dns-admin.dynamite.com. (
20111024 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
@ IN NS dns.dynamite.com.
dns IN A 192.168.1.1
client IN A 192.168.1.10
# vim dynamite.com.rz
$TTL 1D
@ IN SOA dns.dynamite.com. dns-admin.dynamite.com. (
20111024 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
1.168.192.in-addr.arpa. IN NS dns.dynamite.com.
1 IN PTR dns.dynamite.com
10 IN PTR client.dynamite.com
# chkconfig named on
Check whether DNS queries has been resolved or not using the following commands
# dig dns.dynamite.com
# nslookup client.dynamite.com
# nslookup 192.168.1.1
# vim /etc/httpd/conf/httpd.conf
DocumentRoot /rhel6
<Directory /rhel6>
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /rhel6>
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
NameVirtualHost 192.168.1.1:80
<VirtualHost 192.168.1.1:80>
ServerAdmin webmaster@dynamite.com
DocumentRoot /rhel6
ServerName server.dynamite.com
ErrorLog logs/server.dynamite.com-error_log
CustomLog logs/server.dynamite.com-access_log common
</VirtualHost>
# chkconfig httpd on
# vim /etc/hosts
192.168.1.1 server.dynamite.com server
If it shows the all the RHEL6 DVD content then configuration is perfect.
# vim /etc/hosts
192.168.1.1 server.dynamite.com server
# cd/etc/yum.repos.d/
# mv * /tmp
# vim client.repo
[client]
name=RedHat Enterprise Linux 6 Client Repository
baseurl=http://server.dynamite.com/dvd
gpgcheck=0
enabled=1
# yum list
# mkdir /rhel6/dvd
# cp -rvfp/media/RHEL6DVD /rhel6/dvd
# cd /rhel6/dvd/Packages
Note: If it shows up to install some dependency RPMs then install them first then
continue with the above command.
# cd /etc/yum.repos.d
# mv * /tmp
# vim rhel6.repo
[RHEL6]
name=Redhat Enterprise Linux 6 Repository
baseurl=file:///rhel6
gpgcheck=0
enabled=1
# createrepo -v /rhel6/dvd
# yum clean all
# yum repolist