Skip to main content

Posts

How PAM(Pluggable Autthentication Module) Works

PAM (Pluggable Authentication Modules) is one of those dark corners of Linux where most users don't venture - in fact, I'd be willing to bet that the majority of Linux users don't even know what it is. And yet, PAM is at the heart of every single thing in Linux to do with authentication. Take our guided tour of PAM, join our science lab and perform our experiments (no bunsen burner necessary!) and see how PAM gives you fine-grain control over your security policy. Getting to know PAM PAM is a framework that assists applications in performing what I'll call "authentication-related activities". The core pieces of PAM are a library (libpam) and a collection of PAM modules, which are dynamically linked libraries (.so) files in the folder /lib/security. Each module performs one specific task, and a "PAM-aware" application typically uses a stack of several modules to get the job done. Figure 1 below shows the overall architecture. Figure...

sudo-su-vs-sudo-i-vs-sudo-bin-bash-when-does-it-matter-which-is-used

To explain this you need to know what the programs do: su  - The command  su  is used to switch to another user ( s  witch  u  ser), but you can also switch to the root user by invoking the command with no parameter.  su  asks you for the password of the user to switch, after typing the password you switched to the user's environment. sudo  -  sudo  is meant to run a single command with root privileges. But unlike  su  it prompts you for the password of the current user. This user must be in the sudoers file (or a group that is in the sudoers file). By default, Ubuntu "remembers" your password for 15 minutes, so that you don't have to type your password every time. bash  - A text-interface to interact with the computer. It's important to understand the difference between login, non-login, interactive and non-interactive shells: login shell: A login shell logs you into the system as a spiecified user, necessar...

Find/Display your MAC Address Linux/UNIX

How to find/display your MAC Address:Unix/Linux Linux As the root user (or user with appropriate permissions) Type "ifconfig -a" From the displayed information, find eth0 (this is the default first Ethernet adapter) Locate the number next to the  HWaddr . This is your MAC address The MAC Address will be displayed in the form of 00:08:C7:1B:8C:02 . Example "ifconfig -a" output: eth0 Link encap:Ethernet HWaddr 00:08:C7:1B:8C:02 inet addr:192.168.111.20 Bcast:192.168.111.255 Mask:255.255.255.0 ...additional output removed... Solaris/SunOS As the root user (or user with appropriate permissions) Type "/sbin/ifconfig -a" From the displayed information, find the Ethernet adapter (it will probably be called le0 or ie0) Locate the number next to  ether . This is your MAC address The MAC Address will be displayed in the form of  0:3:ba:26:1:b0 -- leading zeros are removed. For this example, the actual MAC Address would be ...

Linux File Systems: Ext2 vs Ext3 vs Ext4

ext2, ext3 and ext4 are all filesystems created for Linux. This article explains the following: High level difference between these filesystems. How to create these filesystems. How to convert from one filesystem type to another. Ext2 Ext2 stands for second extended file system. It was introduced in 1993. Developed by Rémy Card. This was developed to overcome the limitation of the original ext file system. Ext2 does not have journaling feature. On flash drives, usb drives, ext2 is recommended, as it doesn’t need to do the over head of journaling. Maximum individual file size can be from 16 GB to 2 TB Overall ext2 file system size can be from 2 TB to 32 TB Ext3 Ext3 stands for third extended file system. It was introduced in 2001. Developed by Stephen Tweedie. Starting from Linux Kernel 2.4.15 ext3 was available. The main benefit of ext3 is that it allows journaling. Journaling has a dedicated area in the file system, where all the changes are tracked. When th...

The-beginners-guide-to-iptables-the-linux-firewall - Iptables

Iptables is an extremely flexible firewall utility built for Linux operating systems. Whether you’re a novice Linux geek or a system administrator, there’s probably some way that iptables can be a great use to you. Read on as we show you how to configure the most versatile Linux firewall. About iptables iptables is a command-line firewall utility that uses policy chains to allow or block traffic. When a connection tries to establish itself on your system, iptables looks for a rule in its list to match it to. If it doesn’t find one, it resorts to the default action. iptables almost always comes pre-installed on any Linux distribution. To update/install it, just retrieve the iptables package: sudo apt-get install iptables There are GUI alternatives to iptables like  Firestarter , but iptables isn’t really that hard once you have a few commands down. You want to be extremely careful when configuring iptables rules, particularly if you’re SSH’d into a server, because one w...