Sunday, 27 January 2013

How To Enable root Login at Graphical in Fedora 13


How To Enable root Login at Graphical in Fedora 13

In this howto i will describe how to let root user to Graphical Login in Fedora 13. From Fedora 10 it was disable by default to let it login from GUI.We will be configure pam authentication files gdm and gdm-password respectively.
vi /etc/pam.d/gdm
find following line
auth       required    pam_succeed_if.so user != root quiet
comment out by placing # at beginning to disable this check
#auth       required    pam_succeed_if.so user != root quiet
save and close the file.
vi /etc/pam.d/gdm.password
find following line
auth       required    pam_succeed_if.so user != root quiet
comment out by placing # at beginning to disable this check
#auth       required    pam_succeed_if.so user != root quiet
save and close the file. Now logout from terminal or GUI and relogin with root from GUI.

Tuesday, 22 January 2013

Wireless Packet Capture with iwconfig and tcpdump

IP Packet capture

IP Traffic Export Profiles Overview

All packet export configurations are specified using IP traffic export profiles, which consist of IP-traffic-export-related command-line interfaces (CLIs) that control various attributes for both incoming and outgoing exported IP traffic. You can configure a router with multiple IP traffic export profiles. (Each profile must have a different name.) You can apply different profiles on different interfaces.
The two different IP traffic export profiles are as follows:
The global configuration profile, which is configured by the ip traffic-export profile command.
The IP traffic export submode configuration profile, which is configured by any of the following router IP Traffic Export (RITE) commands—bidirectional, incoming, interface, mac-address, and outgoing.

SUMMARY STEPS

1. enable
2. configure terminal
3. ip traffic-export profile profile-name
4. interface interface-name
5. bidirectional
6. mac-address H.H.H
7. incoming {access-list {standard | extended | named} | sample one-in-every packet-number}
8. outgoing {access-list {standard | extended | named} | sample one-in-every packet-number}
9. exit
10. interface type number
11. ip traffic-export apply profile-name

DETAILED STEPS


 
Command or Action
Purpose
Step 1 
enable
Example:
Router> enable
Enables privileged EXEC mode.
Enter your password if prompted.
Step 2 
configure terminal
Example:
Router# configure terminal
Enters global configuration mode.
Step 3 
ip traffic-export profile profile-name
Example:
Router(config)# ip traffic-export profile my_rite
Creates or edits an IP traffic export profile, enables the profile on an ingress interface, and enters RITE configuration mode.
Step 4 
interface interface-name
Example:
Router(config-rite)# interface FastEthernet 0/1
Specifies the outgoing (monitored) interface for exported traffic.
Note If you do not enter this command, the profile will not recognize an interface in which to send the captured IP traffic.
Step 5 
bidirectional
Example:
Router(config-rite)# bidirectional
(Optional) Exports incoming and outgoing IP traffic on the monitored interface.
Note If you do not enable this command, only incoming traffic is exported.
Step 6 
mac-address H.H.H
Example:
Router(config-rite)# mac-address 00a.8aab.90a0
Specifies the 48-bit address of the destination host that is receiving the exported traffic.
Note If you do not enter this command, the profile will not recognize a destination host in which to send the exported packets.
Step 7 
incoming {access-list {standard | extended | named} | sample one-in-every packet-number}
Example:
Router(config-rite)# incoming access-list my_acl
(Optional) Configures filtering for incoming traffic.
After you create a profile using the ip traffic-export profile, this functionality is enabled by default.
Step 8 
outgoing {access-list {standard | extended | named} | sample one-in-every packet-number}
Example:
Router(config-rite)# outgoing sample one-in-every 50
(Optional) Configures filtering for outgoing export traffic.
Note If you enter this command, you must also enter the bidirectional command, which enables outgoing traffic to be exported. However, only routed traffic (such as passthrough traffic) is exported; that is, traffic that originates from the network device is not exported.
Step 9 
exit
Exits RITE configuration mode.
Step 10 
interface type number
Example:
Router(config)# interface FastEthernet0/0
Configures an interface type and enters interface configuration mode.
Step 11 
ip traffic-export apply profile-name
Example:
Router(config-if)# ip traffic-export apply my_rite
Enables IP traffic export on an ingress interface.

Troubleshooting Tips

Creating an IP Traffic Export Profile
The interface and mac-address commands are required to successfully create a profile. If these commands are not entered, you will receive the following profile incomplete message when you enter the show running config command:
ip traffic-export profile newone 
! No outgoing interface configured
! No destination mac-address configured
Applying an IP Traffic Export Profile to an interface
The following system logging messages should appear immediately after you activate and deactivate a profile from an interface (via the ip traffic-export apply profile command):
Activated profile:
%RITE-5-ACTIVATE: Activated IP traffic export on interface FastEthernet 0/0.

Deactivated profile:
%RITE-5-DEACTIVATE: Deactivated IP traffic export on interface FastEthernet 0/0.

If you attempt to apply an incomplete profile to an interface, you will receive the following message:
Router(config-if)# ip traffic-export apply newone
RITE: profile newone has missing outgoing interface

What to Do Next

After you configure a profile and enable the profile on an ingress interface, you can monitor IP traffic exporting events and verify your profile configurations. To complete these steps, see the "Displaying IP Traffic Export Configuration Data" section.

Configuring IP Traffic Capture

IP traffic export provides the capability to export IPO traffic over an Ethernet port. IP traffic capture provides the capability to capture IP packets in local router memory, and then dump this data to a file on an external device, such as flash memory.
IP traffic capture is supported on the Cisco 1841, Cisco 2800 series, and Cisco 3800 series integrated services routers.
The following sections describe the configuration and control of IP traffic capture:

Configuring IP Traffic Capture

Perform the following steps to configure IP traffic capture.

SUMMARY STEPS

1. enable
2. configure terminal
3. ip traffic-export profile profile-name mode capture
4. bidirectional
5. incoming {access-list {standard | extended | named} | sample one-in-every packet-number}
6. outgoing {access-list {standard | extended | named} | sample one-in-every packet-number}
7. length bytes
8. exit
9. interface type number
10. ip traffic-export apply profile-name size size

DETAILED STEPS


 
Command or Action
Purpose
Step 1 
enable
Example:
Router> enable
Enables privileged EXEC mode.
Enter your password if prompted.
Step 2 
configure terminal
Example:
Router# configure terminal
Enters global configuration mode.
Step 3 
ip traffic-export profile profile-name mode capture
Example:
Router(config)# ip traffic-export profile my_rite
Creates or edits an IP traffic export profile for capture and enters RITE configuration mode.
Step 4 
bidirectional
Example:
Router(config-rite)# bidirectional
(Optional) Captures incoming and outgoing IP traffic on the monitored interface.
Note If you do not enable this command, only incoming traffic is captured.
Step 5 
incoming {access-list {standard | extended | named} | sample one-in-every packet-number}
Example:
Router(config-rite)# incoming access-list my_acl
(Optional) Configures filtering for incoming traffic.
After you have created a capture profile using ip traffic-export profile name mode capture, this functionality is enabled by default.
Step 6 
outgoing {access-list {standard | extended | named} | sample one-in-every packet-number}


Example:
Router(config-rite)# outgoing sample one-in-every 50
(Optional) Configures filtering for outgoing captured traffic.
Note If you enter this command, you must also enter the bidirectional command, which enables outgoing traffic to be captured. However, only routed traffic (such as passthrough traffic) is captured; that is, traffic that originates from the network device is not captured.
Step 7 
length bytes
Example:
Router(config-rite)# length 512
Specifies the length of the packet in capture mode. The options are 128, 256, and 512 bytes.
Step 8 
exit
Example:
Router(config-rite)# exit
Exits RITE configuration mode.
Step 9 
interface type number
Example:
Router(config)# interface FastEthernet0/0
Configures an interface type and enters interface configuration mode.
Step 10 
ip traffic-export apply profile-name size size
Example:
Router(config-if)# ip traffic-export apply my_rite size 10000000
Applies IP traffic capture on an ingress interface, and specifies the size of the capture buffer.

Performing IP Traffic Capture

When traffic capture is configured, perform it using with CLI commands. There are commands to clear the capture buffer, to start and stop packet capture, and to copy the capture buffer to an external memory device. These commands are:
traffic-export interface type number clear
traffic-export interface type number start
traffic-export interface type number stop
traffic-export interface type number copy
Use these commands in privileged EXEC mode at your discretion to perform the following operations:

Clear the IP Traffic Capture Buffer

To clear the packet capture buffer for the designated interface, use the traffic-export interface clear command.

Command or Action
Purpose
traffic-export interface type number clear

Example:
Router# traffic-export interface fastethernet0/0 clear
Clears the packet capture buffer.
Note The following system logging message should appear immediately after you enter the command:
%RITE-5-CAPTURE_CLEAR: Cleared IP traffic 
capture buffer for interface FastEthernet0/0

Fedora 13



Fedora 13

Before Installation :
·        Allocate min 512 MB of RAM*
·        Allocate min 12GB Hard disk space*
·        Set root password*
·        Select  all the Packages during installation*

After installation is complete :
·        Create =>  username :  emp
                    password :emp
·        To make installations and settings always go to root : su root
·        Setup hostname :
·        Setup ipaddress :
·        Start services : mysqld, httpd, postgresql by using
service  servicename  start
·        Save service using :
chkconfig   servicename  on
·        To provide rights use : chmod –Rf 777  path
Eg.   Rights to a particular folder named xyz stored in filesystem
Chmod –Rf 777 /xyz

·           To install apache tomcat and jdk1.6.0_26 :
Copy : ‘jdk-6u26-linux-i586.bin, apache-tomcat-6.0.32.tar.gz’ and paste in ‘/’ {open root folder and then press backspace, paste files at here}.

Open terminal & give command ‘cd /’ press enter & type command ‘chmod –Rf  777 jdk-6u26-linux-i586.bin’ and similarly ‘chmod –Rf  777  apache-tomcat-6.0.32.tar.gz’ press enter.

Type : ‘./jdk-6u26-linux-i586.bin’ press enter,

An agreement will be asked, Press                Spacebar
                        Accept the agreement Type                      Yes
Unpacking procedure will begin
     At the end                 Done          will be displayed

After completing Setup type ‘tar –zxvf apache-tomcat-6.0.32.tar.gz’ press enter.

Type : ‘vi /etc/profile’ press enter. (Press ‘I’ for insert & at the end of file u have to type or copy below path)
JAVA_HOME=/jdk1.6.0_26
PATH=/ jdk1.6.0_26/bin:$PATH
export JAVA_HOME PATH
export CATALINA_HOME=/apache-tomcat-6.0.32
export CATALINA_HOME
export CLASSPATH=$CLASSPATH:$CATALINA_HOME/common/lib/servlet-api.jar
------------------  Save the file and exit. (Esc + shift: wq)
·           provide rights to :
chmod –Rf 777 /var/www/html/ (enter)
chmod –Rf 777 /apa(press tab )/ (enter)
chmod –Rf 777 /jdk 1.6.0_26/ (enter)

·            To start apache tomcat server :  cd /apa(press TAB) /(enter and type)sh startup.sh
·            To stop apache tomcat server :  cd /apa(press TAB) /(enter and type)sh shutdown.sh
To check apa… running : open browser enter url : http://localhost:8080/
·         Copy mysql-connector-java-5.1.14.tar in  : /jdk1.6.0_26/jre/lib/ext/
·         To  install PHP drivers : cd  /(Enter and type )yum install php-gd (Enter)

·         Again Do the following :
o   Start services : mysqld, httpd by using
service   servicename  start
o   Save service using :
chkconfig  servicename  on

Monday, 21 January 2013

SAMBA SERVER




client side windows

user : tecmint
passwd: 123456

clint side linux
connect to server
server ip:XXX
share: tecmintusers
username: tecmint

Setup Samba Server Using tdbsam Backend on RHEL/CentOS 6.3/5.8 and Fedora 17-12
Samba is an open source and most popular widely used program that enables end users to access Linux shared directory from any windows machine on the same network. Samba is also named as a network file system and can be installed on Linux/Unix operating systems. Samba itself is a client/server protocol of SMB ( Server Message Block) and CIFS (Common Internet File System). Using windows smbclient (GUI) or file explorer, end users can connect to Samba server from any windows workstations to access shared files and printers.


Samba Server Setup
This tutorial explains how to setup Samba Server (fileserver) Using tdbsam Backend on RHEL 6.3/6.2/6.1/6/5.8, CentOS 6.3/6.2/6.1/6/5.8 and Fedora 17,16,15,14,13,12 systems and also we will learn how to configure it to share files over the network using SMB protocol, as well as we will see how to create and add system users on samba user’s database.

1. Preliminary Note
We are using RHEL 6.3 system with hostname tecmint with IP address 172.16.25.126.
2. Disable SELinux
First, check whether SELinux is currently enabled or disabled with following command.
# selinuxenabled && echo enabled || echo disabled

enabled
In our case, SELinux is currently enabled, so we need to disabled it under RHEL/CentOS/Fedora systems, open file called /etc/selinux/config with your choice of editor. ( Ignore this step, if SELinux is already disabled ).
# vi /etc/selinux/config
And change the line that says SELINUX=enabled to SELINUX=disabled and reboot the system.
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted
3. Rebooting System
Here, we will need to reboot the system to re-lable entire file system in the boot process. This reboot process can take some time, depends on the volume of files.
# init 6
Once the system comes to login prompt, login with root user and start installing Samba package.
3. Installing Samba
We use YUM package manager tool to install Samba packages.
# yum install samba samba-common cups-libs samba-client
4. Configure Samba with tdbsam Backend
Once samba installed successfully, now time to configure it using tdbsam password backend. Open file /etc/samba/smb.conf.
# vi /etc/samba/smb.conf
And check for the following lines in the Standalone Server Options section. This line enables users to login into Samba server.
# ----------------------- Standalone Server Options ------------------------
#
# Scurity can be set to user, share(deprecated) or server(deprecated)
#
# Backend to store user information in. New installations should
# use either tdbsam or ldapsam. smbpasswd is available for backwards
# compatibility. tdbsam requires no further configuration.

        security = user
        passdb backend = tdbsam
5. Creating Samba Share Directory
Now, we will create Samba share directory for sharing files for all users. Run the following commands.
# mkdir -p /home/sambashares/tecmintusers
# chown -R root:users /home/sambashares/tecmintusers
# chmod -R 775 /home/sambashares/tecmintusers
6. Configuring Samba Share Directory
Add following lines at the bottom of the file /etc/samba/smb.conf.
[tecmintusers]
  comment = All Users
  path = /home/sambashares/tecmintusers
  valid users = @users
  force group = users
  create mask = 0660
  directory mask = 0771
  writable = yes
7. Creating Samba Start-up Links
Create system start-up links for Samaba.
# chkconfig --levels 235 smb on
8. Restarting Samba Server
Now restart Samba server.
# /etc/init.d/smb restart
9. Creating Samba Users
We will create a user called tecmint and set password to it.
# useradd tecmint -m -G users
# passwd tecmint
Now add newly created user tecmint to Samba user database and set password for him.
# smbpasswd -a tecmint
This way you can create as many as users you want, just replace the username tecmint with the desired username.
10. Verify Samba Server Share
Verify Samba share directory within Linux system using smbclient package with -L option. It will display list of available samba share directories on the host tecmint.
# smbclient -L tecmint

Domain=[MYGROUP] OS=[Unix] Server=[Samba 3.5.10-125.el6]

        Sharename       Type      Comment
        ---------       ----      -------
        tecmintusers    Disk      All Users
        IPC$            IPC       IPC Service (Samba Server Version 3.5.10-125.el6)
Anonymous login successful
Domain=[MYGROUP] OS=[Unix] Server=[Samba 3.5.10-125.el6]

        Server               Comment
        ---------            -------

        Workgroup            Master
        ---------            -------
Try to login into Samba share directory under Linux system using username as tecmint with password.
# smbclient -L //tecmint/tecmintusers -U tecmint
Enter tecmint's password:
Domain=[MYGROUP] OS=[Unix] Server=[Samba 3.5.10-125.el6]

        Sharename       Type      Comment
        ---------       ----      -------
        tecmintusers     Disk      All Users
        IPC$            IPC       IPC Service (Samba Server Version 3.5.10-125.el6)
        tecmint         Disk      Home Directories
Domain=[MYGROUP] OS=[Unix] Server=[Samba 3.5.10-125.el6]

        Server               Comment
        ---------            -------

        Workgroup            Master
        ---------            -------
11. Login to Samba Server from Windows
Now try to login from your Windows system, open Windows Explorer and type the address \\172.16.25.126\tecmint and enter username as tecmint and password, you will see tecmint’s home directory. Refer screenshot below.

 

 Now to share Samba shared directory type address as \\172.16.25.126\tecmintusers. You will see similar to below.