Subscribe:

Ads 468x60px

Pages

Tuesday, August 2, 2011

Logrotate


Logs are important and usefull in security and administration. If a log grows too much, you compress it , back it up for some months or years and create a new log file. All this is done in a much better way by Logrotate. Logrotate enables you to compress the old logfile, and store it for as long as you want, to run every day, montly, or when you want, and if a file expires, it can send it to you by email or delete it, after for example, 2 years. Old logs can be stored in an alternative directory.

You set up logs configuring /etc/logrotate.conf or adding a new file in /etc/logrotate.d/
For example, a logrotate file for apache looks like this:
File: /etc/logrotate.d/httpd
-------8<-------
/usr/local/apache/logs/*log {
missingok
notifempty
sharedscripts
postrotate
/bin/kill -USR1 `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null || true
endscript
}

-------8<-------

logrotate: show a simple but usefull command that forces the logrotation, independent of the normal execution.
# logrotate -f /etc/logrotate.conf

Read more...

20 Linux Server Hardening Security Tips Securing your Lin20 Linux Server Hardening Security Tips


Securing your Linux server is important to protect your data,  intellectual property, and time, from the hands of crackers (hackers). The system administrator is responsible for security Linux box. In this first part of a Linux server security series, I will provide 20 hardening tips for default installation of Linux system. 

1: Encrypt Data Communication
2: Minimize Software to Minimize Vulnerability
3: One Network Service Per System or VM Instance
4: Keep Linux Kernel and Software Up to Date
5: Use Linux Security Extensions
6: User Accounts and Strong Password Policy
7: Disable root Login
8: Physical Server Security
9: Disable Unwanted Services
10: Delete X Windows
11: Configure Iptables and TCPWrappers
12: Linux Kernel /etc/sysctl.conf Hardening
13: Separate Disk Partitions
14: Turn Off IPv6
15: Disable Unwanted SUID and SGID Binaries
16: Use A Centralized Authentication Service
17: Logging and Auditing
18: Secure OpenSSH Server
19: Install And Use Intrusion Detection System
20: Protecting Files, Directories and Email
Read more...

Logical Volume Manager (LVM)


LVM is a Logical Volume Manager for the Linux operating system. There are now two version of LVM for Linux: 

  • LVM 1: LVM 2 uses the device mapper kernel driver. Device mapper support is in the 2.6 kernel tree and there are patches available for current 2.4 kernels. The version that is in the 2.4 series kernel. LVM 1 is a mature product that has been considered stable for a couple of  years. The kernel driver for LVM 1 is included in the 2.4 series kernels, but this does not mean that your 2.4.x kernel is up to date with the latest version of LVM.
  • LVM 2:  The latest and greatest version of LVM for Linux. LVM 2 is almost completely backward compatible with   volumes created with LVM 1. The exception to this is snapshots (You must remove snapshot volumes before upgrading to LVM 2).

Read more...

Installing Open office


To install open office the following package is required:

  1. openoffice.org-core 
  2. openoffice.org-calc 
  3. openoffice.org-base 
  4. openoffice.org-draw 
  5. openoffice.org-impress 
  6. openoffice.org-langpack-es 
  7. openoffice.org-writer 
  8. hunspell-es 
  9. openoffice.org-extendedPDF

Install the openoffice
# yum -y install openoffice.org-core openoffice.org-calc openoffice.org-base openoffice.org-draw openoffice.org-impress openoffice.org-langpack-es openoffice.org-writer hunspell-es openoffice.org-extendedPDF
Read more...

Installing and configuring dovecot IMAP/POP3 server

The Internet Message Access Protocol (IMAP) is one of the two most prevalent Internet standard protocols for e-mail retrieval. Dovecot is an open source IMAP.

  • IMAP host FQDN: mail1.dev.local, ip: 192.168.10.11, DNS alias: mail.dev.local
  • Mailbox type: Maildir
  • Mail location: /var/mail/<user>
  • Communication: Only secure, TLS/SSL
  • Protocol: TCP.



List of ports used for dovecot

  • Imap - 143
  • Pop3 - 110
  • Imaps - 995
  • Pop3s - 993

Step by step for configuration of dovecot:


Installing the dovecot
# yum install -y dovecot


Modify the configurtions file
# vim /etc/dovecot/dovecot.conf


Uncomment the line to enable the following protocols(imap, pop3)
protocols=imap,pop3


Mail directory
mail_location = maildir:/var/mail/%u


Save the configuration file
:wq


Check whether the port number is exits or not
# netstat -ntlp | grep 143
# netstat -ntlp | grep 110


Restart the dovecot service
# service dovecot restart


Start the service at boot time
# chkconfig dovecot on



Check whether the port number is exits or not
# netstat -ntlp | grep 143
# netstat -ntlp | grep 110

Test mail access
# mutt -f imap://username@servername
# mutt -f pop3://username@servername

Read more...

Mounting ISO image

Place the boot.iso image to the Destop and make mount to /mnt mount point.


Making temporary mounting to /mnt:
# mount -o loop -t iso9660 /root/Desktop/boot.iso /mnt

Read more...

Monday, August 1, 2011

Purpose of last+found Directory


1) last+found it will store corrupted or damage files when the unclean Power failure occur or system shutdown occur.


2) When we create the ext3 file system. 'lost+found' directory is created.
Under these directory if any of the file has been damaged or crash the files will be store under 'lost+found'.

Read more...

Installing VLC player

The VLC media player is an open source media player, distributed under the GNU General Public License. It is a highly portable multimedia player that supports many audio and video codecs and file formats as well as DVDs, VCDs and various streaming protocols. It is able to stream over networks and to transcode multimedia files and save them into various different formats.

Read more...