Powered By Blogger

Tuesday, 28 June 2011

Network Printer install on ubuntu client 10.04


Network Printer install on ubuntu 10.04

1. open browser and type localhost:631 in address bar
2. select adding printers and class
3. select HP LaserJet p2035N and continu
4. select HP and continu
5. select model HP Laserjet p2035 foomatic/foo2zjs
6. click add printer
7. click select default options
8 now printer will be ready for print

Ubuntu 10.04 Password Reset


Ubuntu 10.04 Password Reset

1. Start pc and select first boot option
2. press e (for edit) and go to Kernel Line (Linux /boot/vmlinuz)
3. Replace ro quiet splash to rw init=/bin/bash
4. Presss CTRL+X (for boot) now log on to root
5. run command on terminal (#passwd root) now enter new password
6. reboot 

Sunday, 26 June 2011

How to configure DNS on RHEL5


How to configure DNS on RHEL5.
Version : 1.0
Date : 27-06-2011
Written by : Hafiz Muhammad Amir
Before configuring any server check you hostname it should be FQDN(Fully Qualified
Domain Name)
by command
#hostname
centos.ali.com
If the command does not show the FQDN name then open the file
#vi /etc/sysconfig/network
and edit this line to
HOSTNAME=centos.ali.com
save and exit the file.
# reboot the machine and verify the hostname command.
RedHat starting from version RHEL4 has included extras layer of security with the
name of SELINUX.
Configure selinux properly for specific services like bind,apache,squid,dhcp,ftp etc
otherwise disable it completely.
(Dont keep it just enable without proper configuration).
To check the status of selinux
#sestatus
SELinux status:
disabled
If it is enable on you system then open the file
# vi /etc/sysconfig/selinux
and the change the following line to
SELINUX=disabled
and save the file.
(When ever you change the status of selinux you have to reboot the machine)
-check the bind package
#rpm -qa |grep ^bind
bind-9.3.3-7.el5
bind-utils-9.3.3-7.el5
bind-chroot-9.3.3-7.el5
bind-libs-9.3.3-7.el5
# rpm -q caching-nameserver
cahing-nameserver-9.3.3-7.el5
go the direcoty
# cd /var/named/chroot/etc
In this file will be with the name of named.caching-nameserver.conf
copy this file in the same directory with the name of named.conf
# cp named.caching-nameserver.conf named.conf
Change the group of named.conf file
# chown root.named named.conf
make the symbolic link of named.conf in the /etc dir
# ln -s /var/named/chroot/etc/named.conf /etc/named.conf
# Now open named.conf file and change the followings lines.
Add ip address of server in bracket.
# vi named.conf
listen-on port 53 { 127.0.0.1;192.168.20.100; };
//
// I am using here simple approach of single view.For more advance configuration
// named.conf required multiple views which will be discussed Inshalla later on.
//
Add any in allow-query
allow-query
{ localhost; any; };
Add any in localhost_resolver
view localhost_resolver {
match-clients
{ localhost;
any;
};
save and exit the file.
Now check the systax error of this file by this command
#named-checkconf
Now open another file in the same directory
# vi named.rfc1912.zones
and change the localdomain to your domain name
zone "ali.com" IN {
type master;
file "alirecordfile.zone";
};
and save the file
#now to the the directory
# cd /var/named/chroot/var/named/
In this directory you will see a file named.local copy this file with the same names as
you have
mettioned in named.rfc1912.zones in zone information of your domain (in tab of
file"alirecordfile.zone")
# cp named.local alirecordfile.zone
Change the group of this file.
#chown root.named alirecordfile.zone
Now open this file
#vi alirecordfile.zone
and change the localhost with your fully Qualified Domain name like
$TTL 86400
@
IN
SOA
centos.ali.com. root.localhost. (
1997022700 ; Serial
28800
; Refresh
14400
; Retry
3600000 ; Expire
86400 ) ; Minimum
IN
NS
centos.ali.com.
centos.ali.com. IN A 192.168.20.100
ali.com. IN A 192.168.20.100
Delete the PTR line from this file.
And record the record in this file ans mention above.
Pay special attention to DOT in this file.
There should alwayes be DOT at the end of record named as
centos.ali.com. IN A 192.168.20.100
There must not be DOT at end of ip address
Then save and exit this file.
Now start/restart the named servics.
# service named restart
And check the log file /var/log/messages carefully for any error message
#Now open the file /etc/resolv.conf to the the cleint about its DNS server
# vi /etc/resolv.conf
and add this line
nameserver 192.168.20.100
save and exit the file.
#Then check DNS from you cleint machine by commands, host,nslookup ,dig
like
#dig
centos.ali.com
There should a Answer section in your output which will show the desired query
answer.
;; ANSWER SECTION:
centos.ali.com.
86400 IN
A
192.168.20.100


Kindly : Send you feedback at engamirch@gmail.com to improve documents
My url = engamir.blogspot.com

Tuesday, 14 June 2011

Create snmp server on ubuntu server

Create snmp server on ubuntu server

# Installing SNMP Server in Ubuntu #####

$ sudo apt-get install snmpd snmp

Move existing /etc/snmp/snmpd.conf configuration file to /etc/snmp/snmpd.conf.org

$ sudo mv /etc/snmp/snmpd.conf  /etc/snmp/snmpd.conf.org

Create a new /etc/snmp/snmpd.conf file:

rocommunity  public
syslocation  "PDC, Peters DataCenter"
syscontact  peter@it-slav.net

Make snmpd use the newly created file and make it listen to all interfaces:

Edit /etc/default/snmpd

Change from:

# snmpd options (use syslog, close stdin/out/err).
SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid 127.0.0.1'

To:

# snmpd options (use syslog, close stdin/out/err).
#SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid 127.0.0.1'
SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid -c /etc/snmp/snmpd.conf'

and restart snmpd

/etc/init.d/snmpd restart

$ sudo snmpwalk -Os -c public -v 1 localhost system

Should return a lot of output and:

ysDescr.0 = STRING: Linux stdnet 2.6.32-28-generic-pae #55-Ubuntu SMP Mon Jan 10 22:34:08 UTC 2011 i686
sysObjectID.0 = OID: netSnmpAgentOIDs.10
sysUpTimeInstance = Timeticks: (20647) 0:03:26.47
sysContact.0 = STRING: amirch@uol.edu.pk
sysName.0 = STRING: stdnet
sysLocation.0 = STRING: "Student Proxy Internet"
sysORLastChange.0 = Timeticks: (0) 0:00:00.00
sysORID.1 = OID: snmpFrameworkMIBCompliance
sysORID.2 = OID: snmpMPDCompliance
sysORID.3 = OID: usmMIBCompliance
sysORID.4 = OID: snmpMIB
sysORID.5 = OID: tcpMIB
sysORID.6 = OID: ip
sysORID.7 = OID: udpMIB
sysORID.8 = OID: vacmBasicGroup
sysORDescr.1 = STRING: The SNMP Management Architecture MIB.
sysORDescr.2 = STRING: The MIB for Message Processing and Dispatching.
sysORDescr.3 = STRING: The management information definitions for the SNMP User-based Security Model.
sysORDescr.4 = STRING: The MIB module for SNMPv2 entities
sysORDescr.5 = STRING: The MIB module for managing TCP implementations
sysORDescr.6 = STRING: The MIB module for managing IP and ICMP implementations
sysORDescr.7 = STRING: The MIB module for managing UDP implementations
sysORDescr.8 = STRING: View-based Access Control Model for SNMP.
sysORUpTime.1 = Timeticks: (0) 0:00:00.00
sysORUpTime.2 = Timeticks: (0) 0:00:00.00
sysORUpTime.3 = Timeticks: (0) 0:00:00.00
sysORUpTime.4 = Timeticks: (0) 0:00:00.00
sysORUpTime.5 = Timeticks: (0) 0:00:00.00
sysORUpTime.6 = Timeticks: (0) 0:00:00.00
sysORUpTime.7 = Timeticks: (0) 0:00:00.00
sysORUpTime.8 = Timeticks: (0) 0:00:00.00

great work with ubuntu server

Friday, 27 May 2011

Squid Graph installation in Ubuntu Server

Squid Graph installation in Ubuntu Server

Squid Graph is a free, simple, yet powerful Squid v2 native logfile analysis tool that generates reports with graphical representation of the proxy server’s traffic.

1 apt-get install apache2 perl

2 apt-get install libgd-gd2-perl

3 go to /tmp directory and download squid-graph source code

4 wget http://biznetnetworks.dl.sourceforge.net/project/squid-graph/squid-graph/3.2/squid-graph-3.2.tar.gz

5 unzip squid-graph-3.2

6 tar xzvf squid-graph-3.2.tar.gz -C /etc/init.d/

7 go to /etc/init.d/ and change permission of squid-graph folder

8 chmod +x /etc/init.d/squid-graph/*

9 go to /var/www  and make director squid-graph

10 go to /etc/init.d/squid-graph and run command.

11 ./squid-graph --tcp-only -n -o=/var/www/squid-graph/ --title="proxy" < /var/log/squid/access.log

12 edit crontab with crontab -e and set schedule

13 */5 * * * * /etc/init.d/squid-graph/squid-graph --tcp-only -n -o=/var/www/squid-graph/ --title="proxy" < /var/log/squid/access.log 

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