Pages

Thursday, April 19, 2012

Introduction to Selinux

Security-Enhanced Linux (SELinux) is an implementation of a mandatory access control mechanism in the Linux kernel, checking for allowed operations after standard discretionary access controls are checked. It was created by the National Security Agency and can enforce rules on files and processes in a Linux system, and on their actions, based on defined policy.

When using SELinux, files, including directories and devices, are referred to as objects. Processes, such as a user running a command or the Mozilla Firefox application, are referred to as subjects. Most operating systems use a Discretionary Access Control (DAC) system that controls how subjects interact with objects, and how subjects interact with each other. On operating systems using DAC, users control the permissions of files (objects) that they own. For example, on Linux operating systems, users could make their home directories world-readable, giving users and processes (subjects) access to potentially sensitive information, with no further protection over this unwanted action. Security-Enhanced Linux (SELinux) adds Mandatory Access Control (MAC) to the Linux kernel, and is enabled by default in Red Hat Enterprise Linux.

 The following is an example of the labels containing security-relevant information that are used on processes, Linux users, and files, on Linux operating systems that run SELinux.

This information is called the SELinux context, and is viewed using the ls -Z command:-

 # ls -Z file1 


 -rwxrw-r--   user1      group1         unconfined_u:object_r:user_home_t:s0            file1

In this example, SELinux provides a user (unconfined_u), a role (object_r), a type (user_home_t), and a level (s0). Linux contexts follow the SELinux user:role:type:level

SELinux user :-   The SELinux user identity is an identity known to the policy that is authorized for a specific set of roles, and for a specific MLS range.

 # /usr/sbin/semanage login -l

 Login Name                        SELinux User                     MLS/MCS Range 
 __default__                         unconfined_u                           s0-s0:c0.c1023
 root                                     unconfined_u                          s0-s0:c0.c1023
 system_u                             system_u                                s0-s0:c0.c1023

 Role :- Part of SELinux is the Role-Based Access Control (RBAC) security model. The role is an attribute of RBAC. SELinux users are authorized for roles, and roles are authorized for domains.

Type:-  The type is an attribute of Type Enforcement. The type defines a domain for processes, and a type for files.

Level:-  The level is an attribute of MLS and Multi-Category Security (MCS). An MLS range is a pair of levels, written aslowlevel-highlevel if the levels differ, or lowlevel if the levels are identical (s0-s0 is the same as s0). Each level is a sensitivity-category pair, with categories being optional. If there are categories, the level is written assensitivity:category-set. If there are no categories, it is written as sensitivity. If the category set is a contiguous series, it can be abbreviated. For example, c0.c3 is the same as c0,c1,c2,c3. The /etc/selinux/targeted/setrans.conf file maps levels (s0:c0) to human-readable form (ie. CompanyConfidential)

Tuesday, March 13, 2012



Redhat vs windows 7

Here you go some of the features or Windows 7:-

• Faster, more responsive performance
• Reduce
• Streaming media in your home
• HomeGroup
• Improved taskbar and full-screen previews
• Jump Lists
• Desktop enhancements
• Windows Search
• Better device management
• View Available Network (VAN)
• Recover your data easily with automatic backup to your home and business network
• Work in the language of your choice or switch between any of thirty-five languages
• Watch many of your favorite TV shows for free when and where you want with Internet TV

Now lets consider some of the distinct points of Redhat Linux:-

• Full multitasking— Multiple tasks can be run in the background, and multiple devices, such as a modem, printer, and hard drive, can be accessed at the same time.
• Virtual memory— Linux safely uses a portion of your hard drive as virtual memory, which increases the efficiency of your system by keeping active processes in RAM and placing less frequently used or inactive portions of memory on disk. Virtual memory also utilizes all your system's memory and doesn't allow memory segmentation to occur.
• Hardware support— Linux, especially Intel-based versions, supports nearly all hardware architectures and devices, with the best support for legacy hardware. This is an advantage in that new versions of the operating system will not make your older hardware obsolete.
• The X Window System— The X Window System is a graphics system for UNIX machines. This powerful interface supports many applications and is the standard interface for the industry.
• Built-in networking support— Linux uses standard TCP/IP protocols, including Network File System (NFS), Network Information Service (NIS, formerly known as YP), Session Message Block (SMB), and others. You can access the Internet by connecting your system with an Ethernet card, or a parallel-port, serial cable, or over a modem to another system.
• Shared libraries— Because each command shares a common library of subroutines it can call at runtime, Linux helps saves memory and hard drive space.
• Compatibility with the IEEE POSIX.1 standard— Because of this compatibility, Linux supports many of the standards set forth for all UNIX systems.
• Open Source code— The Linux kernel uses no code from AT&T or any other proprietary source. This allows other organizations, the GNU project, hackers, and programmers from all over the world to develop and contribute software for Linux.
• Documentation— Nearly every Linux distribution comes with more than 12,000 pages of documentation in the form of manual pages, info documents, or guides. You'll also find extra technical documentation for software packages under the /usr/share/doc directory. Unlike operating systems offered by the monopolistic software industry, Linux is fully documented—one problem might be that there is too much information!
• Lower cost than most other UNIX systems and UNIX clones— If you have a fast Internet connection and a CDR drive, you can freely download Linux off the Internet. Many books also come with a free copy (this book includes the latest version of Intel-based Red Hat Linux on the CD-ROMs).
• GNU software support— Linux can run a wide range of free software available through the GNU project. This software includes everything from programming tools, such as compilers, assemblers, linkers, and loaders, to system administration utilities, such as stream editors, the venerable emacs editor, and even games.

Friday, February 24, 2012

EIGRP Frame Relay Hub and Spoke




Configuring the Frame Relay Switch


hostname FRS
!
frame-relay switching
!
interface Serial 0/0
description FR to HQ
encapsulation frame-relay
clock rate 6400
frame-relay lmi-type cisco
frame-relay intf-type dce
frame-relay route 102 interface Serial 0/1 201
frame-relay route 103 interface Serial 0/2 301
no shutdown
!
interface Serial 0/1
description FR to East
no ip address
encapsulation frame-relay
clock rate 64000
frame-relay lmi-type cisco
frame-relay intf-type dce
frame-relay route 201 interface Serial 0/0 102
no shutdown
!
Interface Serial 0/2
description FR to West
no ip address
encapsulation frame-relay
clock rate 64000
frame-relay lmi-type cisco
frame-relay intf-type dce
frame-relay route 301 interface Serial 0/0 103
no shutdown

Configuring the Frame Relay Endpoints


R1# conf t
R1(config)# interface serial 0/0
R1(config-if)# ip address 10.1.1.1 255.255.255.0
R1(config-if)# encapsulation frame-relay
R1(config-if)# no frame-relay inverse-arp
R1(config-if)# frame-relay map ip 10.1.1.1 103
R1(config-if)# frame-relay map ip 10.1.1.2 102 broadcast
R1(config-if)# frame-relay map ip 10.1.1.3 103 broadcast
R1(config-if)# no shutdown

R2# conf t
R2(config)# interface serial 0/1
R2(config-if)# ip address 10.1.1.2 255.255.255.0
R2(config-if)# encapsulation frame-relay
R2(config-if)# no frame-relay inverse-arp
R2(config-if)# frame-relay map ip 10.1.1.2 201
R2(config-if)# frame-relay map ip 10.1.1.1 201 broadcast
R2(config-if)# frame-relay map ip 10.1.1.3 201 broadcast
R2(config-if)# no shutdown

R3# conf t
R3(config)# interface serial 0/2
R3(config-if)# ip address 10.1.1.3 255.255.255.0
R3(config-if)# no frame-relay inverse-arp
R3(config-if)# encapsulation frame-relay
R3(config-if)# frame-relay map ip 10.1.1.3 301
R3(config-if)# frame-relay map ip 10.1.1.1 301 broadcast
R3(config-if)# frame-relay map ip 10.1.1.2 301 broadcast
R3(config-if)# clock rate 64000
R3(config-if)# no shutdown

Configuring EIGRP


R1(config)# router eigrp 1
R1(config-router)# network 10.0.0.0
R1(config-router)# network 172.16.0.0
R1(config-router)# no auto-summary

R2(config)# router eigrp 1
R2(config-router)# network 10.0.0.0
R2(config-router)# network 172.16.0.0
R2(config-router)# no auto-summary

R3(config)# router eigrp 1
R3(config-router)# network 10.0.0.0
R3(config-router)# network 172.16.0.0
R3(config-router)# no auto-summary


R2# show ip eigrp topology
IP-EIGRP Topology Table for AS(1)/ID(172.16.124.2)

Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
r - reply Status, s - sia Status

P 172.16.1.0/24, 1 successors, FD is 128256 via Connected, Loopback1
P 172.16.1.0/24, 1 successors, FD is 40640000 via 172.16.124.1 (40640000/128256), Serial0/0/1
P 10.1.1.0/24, 1 successors, FD is 40512000 via Connected, Serial 0/1

Note:- By Default split horizon is enabled so troute advertisements from R2 to R1 do not travel to R3 and vice versa, as shown in the above output.

R1 needs the no ip split-horizon eigrp 1 command on its serial Frame Relay interface. to fix this issue

R1(config)# interface serial 0/0
R1(config-if)# no ip split-horizon eigrp 1


Verify that you see the correct EIGRP adjacencies with the show ip eigrp neighbors command:

R1# show ip eigrp neighbors
IP-EIGRP neighbors for process 1
H Address Interface Hold Uptime SRTT RTO Q Seq
(sec) (ms) Cnt Num
1 10.1.1.2 Se0/0 176 00:00:05 1588 5000 0 6
0 10.1.1.3 Se0/0 176 00:00:05 23 1140 0 6

R2# show ip eigrp neighbors
IP-EIGRP neighbors for process 1
H Address Interface Hold Uptime SRTT RTO Q Seq
(sec) (ms) Cnt Num
0 10.1.1.1 Se0/1 129 00:00:52 20 2280 0 20


Verify that you have IP routes on all three routers and verify full connectivity

R2# ping 10.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.1, timeout is 2 seconds:
!!!!!

R2# ping 10.1.1.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.3, timeout is 2 seconds:
!!!!!

Thursday, February 23, 2012

How to Configure Frame Relay



Configuration of Frame Relay..............

DLCI Number:-
201 – 102 = Headoffice to Mumbai
301 - 103 = Headoffice to AHE
204 – 206 = AHE to Mumbai
Frame Relay Switch:-

FRS(Config)#frame-relay switching
FRS (Config)#int s0/0
FRS (Config-if) #encapsulation frame-relay
FRS (Config-if)#Frame-relay int-type dce
FRS (Config-if)#clock rate 64000
FRS (Config-if)#no frame-relay inverse-arp
FRS (Config-if)#frame-relay lmi-type cisco
FRS (Config-if)#no shut
FRS (Config-if)#frame-relay route 102 int s0/1 201
FRS (Config-if)#frame-relay router 103 int s0/2 301
FRS (Config)#int s0/1
FRS (Config-if) #encapsulation frame-relay
FRS (Config-if)#Frame-relay int-type dce
FRS (Config-if)#clock rate 64000
FRS (Config-if)#no frame-relay inverse-arp
FRS (Config-if)#frame-relay lmi-type cisco
FRS (Config-if)#no shut
FRS (Config-if)#frame-relay route 201 int s0/1 102
FRS (Config-if)#frame-relay router 206 int s0/2 204
FRS (Config)#int s0/2
FRS (Config-if) #encapsulation frame-relay
FRS (Config-if)#Frame-relay int-type dce
FRS (Config-if)#clock rate 64000
FRS (Config-if)#no frame-relay inverse-arp
FRS (Config-if)#frame-relay lmi-type cisco
FRS (Config-if)#no shut
FRS (Config-if)#frame-relay route 301 int s0/1 103
FRS (Config-if)#frame-relay router 204 int s0/2 206
Headoffice:-

Headoffice(config)#int s0/0
Headoffice(config-if)#ip address 10.0.0.1 255.255.255.0
Headoffice(config-if)#frame-relay int-type dte
Headoffice(config-if)#no frame-relay inverse-arp
Headoffice(config-if)#frame-relay map ip 10.0.0.2 102 broadcast
Headoffice(config-if)#frame- relay map ip 10.0.0.3 103 broadcast
Headoffice(config-if)#no shut
Mumbai:-

Mumbai(config)#int s0/0
Mumbai(config-if)#ip address 10.0.0.2 255.255.255.0
Mumbai (config-if)#frame-relay int-type dte
Mumbai (config-if)#no frame-relay inverse-arp
Mumbai (config-if)#frame-relay map ip 10.0.0.1 201 broadcast
Mumbai (config-if)#frame- relay map ip 10.0.0.3 206 broadcast
Mumbai (config-if)#no shut
AHE:-

AHE(config)#int s0/0
AHE(config-if)# ip address 10.0.0.3 255.255.255.0
AHE(config-if)#frame-relay int-type dte
AHE(config-if)#no frame-relay inverse-arp
AHE(config-if)#frame-relay map ip 10.0.0.1 204 broadcast
AHE(config-if)#frame- relay map ip 10.0.0.2 301 broadcast
AHE(config-if)#no shut

How to Configure RIS Server in Linux




Configuration Setup of RIS Server:-

Step 1) Configure the DNS Server (Netexpertsindia.COM) Server Name:- server.netexpertsindia.com ( DNS Server use for Name Resloution )
Step 2) Configure the DHCP Server (1.0.0.10-1.0.0.254) ( DHCP Server Provide IP Address to Client PC)
Step 3) Yum Server

*****How to Configure YUM Server *******

#mount /dev/cdrom /mnt
#Cd /mnt/Server
#rpm –ivh vsftpd
#cp –av /mnt/. /var/ftp/pub/
#cp /mnt/Server/repodata/comps-rhel5-server-core-xml /var/ftp/pub/Server
#cp /mnt/VT/repodata/comps-rhel5-vt-xml /var/ftp/pub/VT
#cp /mnt/Cluster/repodata/comps-rhel5-cluster-xml /var/ftp/pub/Cluster
#cp /mnt/ClusterStorage/repodata/comps-rhel5-cluster-st- xml /var/ftp/pub/ClusterStorage
#rpm –ivh createrepo
#creatrepo -vg comps-rhel5-server-core-xml /var/ftp/pub/Server
#creatrepo -vg comps-rhel5-vt-xml /var/ftp/pub/VT
#creatrepo -vg comps-rhel5-cluster-xml /var/ftp/pub/Cluster
#creatrepo -vg comps-rhel5-cluster-st-xml /var/ftp/pub/ClusterStorage

#vim /etc/yum.repos.d/yum.repo
Press i
[server]
Name=yum
Baseurl=ftp://1.0.0.1/pub/Server
Gpgcheck=0
[VT]
Name=yum
Baseurl=ftp://1.0.0.1/pub/VT
Gpgcheck=0
[Cluster]
Name=yum
Baseurl=ftp://1.0.0.1/pub/Cluster
Gpgcheck=0
[ClusterStorage]
Name=yum
Baseurl=ftp://1.0.0.1/pub/ClusterStorage
Gpgcheck=0
:wq (Save and Exit)
#yum grouplist

Step 4) TFTP Server

*****How to Configure TFTP Server *******


Step:-

#yum install tftp
#vim /etc/xinetd.d/tftp

disable = no (default yes change to no)
:wq
#cd /tftpboot
#mkdir /tftpboot/pxelinux.cfg
#cp –av /var/ftp/pub/isolinux/. /tftpboot
#cp –av /tftpboot/isolinux.cfg /tftpboot/pxelinux.cfg/default
#vim /tftpboot/pxelinux.cfg/default
default local (default set linux change into local )
:wq


Setup 5) Editing in DHCP Configuration File:-

Step :-
#vim /etc/dhcpd.conf
After the
Ignore client-update line inset following line:-
allow bootp;
allow booting;
class “pxeclients” {
match if substring(option vendor-class-identifier, 0, 9) = “PXEClient”;
next-server 1.0.0.1;
filename “pxelinux.0”;
}
:wq


6) Start the Following Services:-

#service vsftpd restart
#service named restart
#service dhcpd restart
#service xinted restart
Note: - If you have get error “File not Found” run the Following Command:-
#cp /usr/lib/syslinux/pxelinux.0 /tftp



*******************Enjoy*******************