Skip to main content

Posts

Showing posts from February, 2016

How To View and Configure Linux Logs on Ubuntu and CentOS

Introduction Linux system administrators often need to look at log files for troubleshooting purposes. In fact, this is the first thing any sysadmin would do. Linux and the applications that run on it can generate all different types of messages, which are recorded in various log files. Linux uses a set of configuration files, directories, programs, commands and daemons to create, store and recycle these log messages. Knowing where the system keeps its log files and how to make use of related commands can therefore help save valuable time during troubleshooting. In this tutorial, we will have a look at different parts of the Linux logging mechanism. Disclaimer The commands in this tutorial were tested in plain vanilla installations of CentOS 6.4, Ubuntu 12 and Debian 7. Default Log File Location The default location for log files in Linux is /var/log. You can view the list of log files in this directory with a simple ls -l /var/log command. This is what I see in

20 Iptables Examples For New SysAdmins

L inux comes with a host based firewall called Netfilter. According to the official project site: Netfilter is a set of hooks inside the Linux kernel that allows kernel modules to register callback functions with the network stack. A registered callback function is then called back for every packet that traverses the respective hook within the network stack. This Linux based firewall is controlled by the program called iptables to handles filtering for IPv4, and ip6tables handles filtering for IPv6. I strongly recommend that you first read our quick tutorial that explains how to configure a host-based firewall called Netfilter  (iptables) under CentOS / RHEL / Fedora / Redhat Enterprise Linux. This post lists most simple iptables solutions required by a new Linux user to secure his or her Linux operating system from intruders. IPTABLES Rules Example Most of the actions listed in this post written with the assumption that they will be executed by the root user running the ba