Wednesday, December 5, 2012

Set a banner for ssh


nano /etc/motd

**************************************************************

Hello you,

Welcome to Sourav's area.

Have fun.

**************************************************************

save the file

service iptables restart

an error service not found

just create a symbolic link

ln -s /sbin/service /usr/bin

then service iptables restart will work fine


Change default port and disable root login in ssh and configure iptables accordingly


nano /etc/ssh/sshd_config



uncomment the line


#Port 22


and make it


Port 31111


then go to 


#PermitRootLogin   yes


and make it


PermitRootLogin   no


save the file


service sshd restart

now if I try to access my server using ssh with 31111 port

ssh -p 31111 10.10.1.1


it won't be accessible,we need to configure IPTABLES to make the port 31111 accessible from outside  

go to 

nano /etc/sysconfig/iptables

After the line


-A FORWARD -i eth1 -o eth0 -j ACCEPT

put this line

-A INPUT -p tcp -m state --state NEW -m tcp --dport 31111 -j ACCEPT

save the file

service iptables restart

ssh -p 31111 10.10.1.1

will prompt you to login with root

thoough you can not login with root as expected

so

useradd subrata

passwd subrata

set subrata's password

add subrata to the wheel group

nano /etc/group

go to the line 


wheel:x:10:root

make it


wheel:x:10:root,subrata

save the file

now subrata is in wheel group

go to 

nano /etc/sudoers

go to 


## Allows people in group wheel to run all commands
# %wheel        ALL=(ALL)       ALL

uncomment the second line so that it looks like


## Allows people in group wheel to run all commands
 %wheel        ALL=(ALL)       ALL

save the file

now using subrata you can do every thing



ssh -p 31111 subrata@10.10.1.1 will work just fine.







Tuesday, December 4, 2012

Securing Linux,enabling an user to be root only if it is in wheel group



nano /etc/pam.d/su


go to

#Uncomment the following line to require a user to be in the "wheel" group.

#auth                   required                          pam_wheel.so use_uid

uncomment the line so that it looks like 


auth                   required                          pam_wheel.so use_uid

DHCP configuration file in CentOS 5

It is  /etc/dhcpd.conf  in CentOS 5

The commented out lines are for address reservation.


#
# DHCP Server Configuration file.
#   see /usr/share/doc/dhcp*/dhcpd.conf.sample 




ddns-update-style interim;
allow booting;
allow bootp;
ignore client-updates;

set vendorclass=option vendor-class-identifier;

subnet 10.10.1.0 netmask 255.255.255.0 {

option routers 10.10.1.1;
option domain-name-servers 192.168.163.2;
option subnet-mask 255.255.255.0;
range 10.10.1.15 10.10.1.25;
filename "/pxelinux.0";
default-lease-time 21600;
max-lease-time 43200;
next-server 10.10.1.1;
}



#host  client {

#hardware-ethernet 00:0C:29:BC:55:9C ;
#fixed-address  10.10.1.15;
#}









Sunday, December 2, 2012

Configure Cisco ASA 8.4 in GNS 3 step by step



 Download the ASA 8.4 files for GNS3 from this link


http://www.mediafire.com/download.php?l010dd0c1nayf0d

Now configure ASA under QEMU in GNS 3 like this

Qemu Options: -vnc none -vga none -m 1024 -icount auto -hdachs 980,16,32

Kernel cmd line: -append ide_generic.probe_mask=0x01 ide_core.chs=0.0:980,16,32 auto nousb console=ttyS0,9600 bigphysarea=65536






activation-key 0x4a3ec071 0x0d86fbf6 0x7cb1bc48 0x8b48b8b0 0xf317c0b5

activation-key 0xb23bcf4a 0x1c713b4f 0x7d53bcbc 0xc4f8d09c 0x0e24c6b6

source:http://www.xerunetworks.com/2012/02/cisco-asa-84-on-gns3/