Posts

Showing posts from July, 2009

Hardening Linux Server

Some Steps Installation of Linux OS Install the OS with minimal installation, then proceed to install only the required packages. Removing the unwanted packages in os like gnome, kde,games,Openoffice not needed for server configuration. Securing the Bootloader Grub should be configured with password Restrict access to Server /etc/hosts.allow and /etc/hosts.deny should be configured Modify /etc/hosts.allow Suggested format: # Approved IP addresses ALL: 192.168.0.1 ALL: 192.168.5.2 # CSV uploader machine proftpd: 10.0.0.5 # pop3 from anywhere ipop3: ALL Modify /etc/hosts.deny ALL:ALL EXCEPT localhost:DENY Securing SSH vi /etc/ssh/ssh_config change the following protocol 2,1 to protocol 2 PermitRootLogin yes to PermitRootLogin no Restart SSHD: /etc/rc.d/init.d/sshd restart Setting SSH Banner for the making user to consent to the terms & conditions # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #****************...

Service Start And Stop /Directory Path and Port Number

Service ssh Application Startup directory /etc/init.d/ Startup Method service sshd start Log file /var/log/secure Ports 22 *************************************************** Service snmp Application Startup directory /etc/init.d/ Startup Method service snmpd start Log file /var/log/snmpd.log Ports 199 *************************************************** Service httpd Application Startup directory /etc/init.d/ Startup Method Service httpd start Log file var/loh/httpd/access.log Ports 80 *************************************************** Service dhcpd Application Startup directory /etc/init.d/ Startup Method Service dhcpd start Log file /var/log/dhcpd.log Ports 67 *************************************************** Service DNS Application Startup directory /etc/init.d/ Startup Method Service named start Log file /var/log/messages Ports 53 *************************************************** Service Mysql Applicati...

Steps for Connecting TATA INDICOM internet (Plug 2 surf Whiz) in Linux pc

STEP 1: now open the file #vim /etc/wvdial.conf STEP 2: erase all the content of this file and paste following lines #[Dialer Defaults] #Phone = #777 #Username = internet #Password = internet #New PPPD = yes [Dialer Defaults] Modem = /dev/ttyACM0 Baud = 115200 Setvolume = 0 #Dial Command = ATDT Init1 = ATZ #Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 Modem Type = Analog Modem FlowControl = Hardware (CRTSCTS) [Dialer Defaults] #ISDN = 0 Modem Type = Analog Modem Username = internet Password = internet Phone = #777 Stupid Mode = 1 #Init1 = ATZ #Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 #Inherits = Modem0 :wq! save and exit STEP 3: #vim /etc/resolv.conf nameserver 203.197.12.30 nameserver 202.54.1.18 :wq! save and exit STEP 4: Now open another terminal and run this command rajesh@rajesh:~$ wvdial --> WvDial: Internet dialer version 1.60 --> Cannot get information for serial port. --> Initializing modem. --> Sen...

linux questions

1. Q. How do you list files in a directory? A. ls - list directory contents ls (-l use a long listing format) 2. Q. How do you list all files in a directory, including the hidden files? A. ls -a (-a, do not hide entries starting with .) 3. Q. How do you find out all processes that are currently running? A. ps -f (-f does full-format listing.) 4. Q. How do you find out the processes that are currently running or a particular user? A. ps -au Myname (-u by effective user ID (supports names)) (a - all users) 5. Q. How do you kill a process? A. kill -9 8 (process_id 8) or kill -9 %7 (job number 7) kill -9 -1 (Kill all processes you can kill.) killall - kill processes by name most (useful - killall java) 6. Q. What would you use to view contents of the file? A. less filename cat filename pg filename pr filename more filename most useful is command: tail file_name - you can see the end of the log file. 7. Q. What would ...