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