Powered By Blogger

Wednesday, 20 April 2011

samba domain on centos

first install samba rpm package
go to vim /etc/samba/smb.conf

 define domain

workgroup = mydomain.com
Uncoment all the folowing
hostallow
localmaster=yes
os level = increase the number
domainmaster=yes
prefered master = yes
domain logon=yes
wins support =yes
and also uncoment the following portion
[netlogon]

:wq
save and exit

#service smb restart

now

#useradd -M -s /sbin/nologin winxp$

whrer winxp is the machine name of xp client
#smbpasswd -am winxp

now at client side

roght click the my computer icon
go to properties
go to computer name tab
clik change tabe
give the domain name given in /etc/samba/smb.conf
give user name and password
the user should have super user rihts
u can give user root and for passwd go to linux mache and set root passwd

#smbpasswd root

Tuesday, 19 April 2011

NTP Server configuration on Ubuntu Server and client

Configuration of NTP Server on Ubuntu Server

1. Install the NTP daemon

First, install the NTP daemon (ntpd):

# sudo aptitude install ntpd

2. Configure the daemon properly

The configuration file for ntpd is located at /etc/ntp.conf.
The first section you may want to modify is the list of servers to synchronize with. The default section probably looks as follows:

# vim /etc/ntp.conf


server ntp.ubuntu.com
server nist1-dc.WiTime.net iburst
server ntp0.mcs.anl.gov
server 0.us.pool.ntp.org
server 1.us.pool.ntp.org
server 2.us.pool.ntp.org
server 3.us.pool.ntp.org

Also, add a few extra lines to the bottom of your servers list to provide your current local time as a default should you temporarly lose Internet connectivity:

server 127.127.1.0
fudge 127.127.1.0 stratum 10

# Allow LAN machines to synchronize with this ntp server

restrict 10.1.1.0 mask 255.0.0.0 nomodify notrap

Save and Exit

3. Make sure the configuration works

#/etc/init.d/ntp restart


If this message never comes, you have not yet properly synchronized with the NTP server network. Check the list of NTP peers you are communicating with using the following:


#ntpq -c lpeer

If the 'delay', 'offset', and 'jitter' fields are non-zero and you haven't synchronized, it probably means that you just need to wait a while. Check again that you've inserted the 'iburst' argument to your servers list! My peers, for reference, look something like the following:

Code:

     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*milo.mcs.anl.go 192.5.41.40      2 u    4   64   77   46.213   67.753   2.207
-europium.canoni 193.79.237.14    2 u   63   64   37   97.375   71.020   1.875
-dtype.org       69.25.96.13      2 u    2   64   77   86.956   69.178   1.804
+smtp130.junkema 216.218.254.202  2 u    2   64   77   87.266   67.677   0.916
+kechara.flame.o 216.218.254.202  2 u    -   64   77   89.183   68.717   1.713
-host2.kingrst.c 99.150.184.201   2 u    -   64   77   24.306   62.121   2.608
 LOCAL(0)        .LOCL.          10 l   59   64   37    0.000    0.000   0.002

Your NTPD server Successfully Configure.

UBUNTU Client Configuration.

First install ntp package on client side

#sudo apt-get install ntp

open /etc/ntp.conf

#vim /etc/ntp.conf

server 10.1.1.1


# Local users may interrogate the ntp server more closely.
restrick 10.1.1.1
restrick 127.0.0.1

Now you need to save and exit the file

Run ntpdate command against your server

sudo ntpdate 10.1.1.1

Windows Clients Configuration

Windows machines use a simplified version of NTP called Simple Network Time Protocol (SNTP), and can synchronize with NTP servers. In order to synchronize with your new server, double click on the time and go to the “Internet Time” tab. Put the IP address of your server in the “Server” field.

or

You can download Automachron from here and install in your windows xp/2000 machines

http://www.ubuntugeek.com/network-time-protocol-ntp-server-and-clients-setup-in-ubuntu.html

Monday, 11 April 2011

NIS Server Configuration in Centos

NIS Server Configuration

1st add users

[root@server ~]# adduser joao; passwd joao
[root@server ~]# adduser jose; passwd jose
[root@server ~]# adduser maria; passwd maria

2- Put an entry into /etc/exports like that below.

# vim /etc/exports

/home *(rw,sync)
/common *(rw,sync)

3- Run “exportfs -a” command.

[root@server ~]# exportfs -a

4- Make sure that nfs is enabled during boot time.

[root@server ~]# chkconfig nfs on

[root@server ~]# chkconfig –list nfs

5- Start nfs deamon.

[root@server ~]# service nfs start
Starting NFS services: [ OK ]
Starting NFS quotas: [ OK ]
Starting NFS daemon: [ OK ]
Starting NFS mountd: [ OK ]

Setting and installing NIS

1- Installing through yum. By default RHEL installs portmap, ypbind as well as yp-tools but
unfortunately it cannot be installed. To make sure type:

[root@server ~]# yum install portmap ypserv ypbind yp-tools

2- Open /etc/yp.conf and add new friendly lines: Where queirozpacheco.com is the domain and
server.queirozpacheco is the server.

Make sure if it hasn’t been defined in /etc/hosts yet.

[root@server ~]# vi /etc/yp.conf

domain nis.albiruni.comserver nis.albiruni.com

3- Type on shell these commands below.

[root@server ~]# domainname nis.albiruni.com
[root@server ~]# ypdomainname nis.albiruni.com

4- Start up ypserv service and put an entry in /etc/sysconfig/network file.

[root@server ~]# service ypserv start
Starting YP server services: [ OK ]

[root@server ~]# vim /etc/sysconfig/network
NISDOMAIN=nis.albiruni.com.com

5- Generate NIS init maps.

[root@server ~]# /usr/lib/yp/ypinit -m

Press Ctrl+d

next host to add:

Is this correct? [y/n: y] y
We need a few minutes to build the databases…
Building /var/yp/queirozpacheco.com/ypservers…
Running /var/yp/Makefile…
gmake[1]: Entering directory `/var/yp/nis.albiruni.com’
Updating passwd.byname…
Updating passwd.byuid…
Updating group.byname…
Updating group.bygid…
Updating hosts.byname…
Updating hosts.byaddr…
Updating rpc.byname…
Updating rpc.bynumber…
Updating services.byname…
Updating services.byservicename…
Updating netid.byname…
Updating protocols.bynumber…
Updating protocols.byname…
Updating mail.aliases…
gmake[1]: Leaving directory `/var/yp/nis.albiruni.com.com’

server has been set up as a NIS master server.

Now you can run ypinit -s server on all slave server.
[root@server ~]#

6- Start up ypbind service.

[root@server ~]# service ypbind start
Binding to the NIS domain: [ OK ]
Listening for an NIS domain server.
[root@server ~]#

7- Start up yppasswdd service.

[root@server ~]# service yppasswdd start
Starting YP passwd service: [ OK ]
[root@server ~]#

8- Start up ypxfrd and portmap services.

[root@server ~]# service portmap start
Starting portmap: [ OK ]
[root@server ~]# service ypxfrd start
Starting YP map server: [ OK ]
[root@server ~]#

9- Make sure that these one will startup during the boot process.

[root@server ~]# for i in ypserv ypbind yppasswdd portmap ypxfrd; do chkconfig $i on; done
[root@server ~]#

10- were you thinking to check if ypserv is working correctly? Try this one.

[root@server ~]# rpcinfo -u localhost ypserv
program 100004 version 1 ready and waiting
program 100004 version 2 ready and waiting
[root@server ~]#

11- Finally, run make command in /var/yp directory.

[root@server ~]# cd /var/yp/
[root@server yp]# make
gmake[1]: Entering directory `/var/yp/nis.albiruni.com’
Updating netid.byname…
gmake[1]: Leaving directory `/var/yp/nis.albiruni.com’
[root@server yp]#

Client Setting on Server

Configuring AutoFS to mount /home directories.

1- Setting /etc/auto.master.

[root@host etc]# mv auto.master auto.master.backup

[root@host etc]# vi auto.master

/home /etc/auto.home –timeout 300

2- Create /etc/auto.home and make it out like this.

[root@host etc]# vi auto.home

* -fstype=nfs,soft,rsize=8192,wsize=8192,intr,tcp server:/home/&

3- Make sure if the nfs service works.

[root@host etc]# mount nis:/home /home
[root@host etc]# mount | grep nis
server:/home on /home type nfs (rw,addr=192.168.1.13)

Unmount at once.

[root@host etc]# umount /home

4- Install ypbind and portmap.

[root@host etc]# yum install ypbind portmap

5- Set through system-config-authentication tool as NIS client configuring:

Domain: nis.albiruni.com
Server: nis.albiruni.com

or Edit yp.conf in /etc like this. Edit also /etc/nsswitch.conf

domain nis.albiruni.com server nis.albiruni.com

and Edit nssswitch.conf and put these lines into that.

passwd: files nis

shadow: files nis

group: files nis

6- start up ypbind, autofs and portmap. Make sure that they will be startup during the boot.

[root@host ~]# service portmap start
[root@host ~]# service ypbind start
[root@host ~]# service autofs start

————————————-

[root@host ~]# for i in portmap autofs ypbind; do chkconfig $i on; done

7- You can try this to check if is working or not.

[root@host ~]# ypcat passwd
jose:$1$CSjl0r3p$BkSouhc2ENyZwsGAdO.58.:502:502::/home/jose:/bin/bash
joao:$1$kDne475.$1/XLOERyzye9uG4stE8Kc.:500:500::/home/joao:/bin/bash
maria:$1$xB8Livy9$jS7lpQubNdQxCIISEjln71:501:501::/home/maria:/bin/bash
[root@host ~]#

———————–

[root@host ~]# rpcinfo -u localhost ypbind
program 100007 version 1 ready and waiting
program 100007 version 2 ready and waiting
[root@host ~]#

Okay… Now, let’s get started to trying.

[root@server ~]# ssh jose@host
jose@host’s password:
Last login: Mon Feb 22 23:00:58 2010 from nis