Hello ?

What are we gonna talk about?

Abhishek Bundela
@abhibundela
Vijay Krishnavanshi
@vkrishnavanshi

Content

  • What is file system?
  • Type of file-system?
  • Which one should you choose?
  • Directory Structure

What is a file system and why should you care about it?

A file-system is the methods and data structures that an operating system uses to keep track of files on a disk or partition*

Before a disk or partition can be used as a file system its data structures need to be initialised.

FS Name Year Introduced Original OS Max File Size Max FS Size Journaling
FAT16 1983 MSDOS V2 4GB 16MB to 8GB N
FAT32 1997 Windows 95 4GB 8GB to 2TB N
NTFS 1993 Windows NT 16EB 16EB Y
HFS+ 1998 Mac OS 8EB ? N
ext2 1993 Linux 16GB to 2TB4 2TB to 32TB N
ext3 1999 Linux 16GB to 2TB4 2TB to 32TB Y
XFS 1994 IRIX 9EB 9EB Y

Types of most common file-systems -

Which file system should you use?

Well it depends on your choice like what you want to do with it. If you need to set up a server you should use centralised file system as you would wan to have some control over you user.

Linux uses centralised file system as you will find everything under root (/) that is one of the reason why you se linux everywhere on servers.

For Linux, ext4 or ext3 are most popular file-systems, because they are journaled.

Say you have root (/)

Now What ?

Lets walk through / directory :-

/bin - the bin directory contains several useful commands that are of use to both the system administrator as well as non-privileged users. It usually contains the shells like bash, csh, etc.... and commonly used commands like cp, mv, rm, cat, ls.

All that a root user can need to repair a system is here.

/boot - directory stores data that is used before the kernel begins executing user-mode programs.

This directory store GRUB. Next time you grub goes missing you know where to find it.

/dev - is the location of special or device files. Here you can find you hard drives, pen drives, speakers and what not. Anything that is connected to your system is listed here.

/etc - It is the configuration centre of your system. It contains all system related configuration files in here or in its sub-directories.

Important places /etc/apt/, /etc/sudoers

/initrd.img - This is the RAM disk that can then be mounted as the root file system and programs can be run from it.

/lib - It contains all that library that is required by the commands in /bin and /sbin

/lost+found - Its exactly what it sounds :P

Sometimes when your system might crash or a power failure might take the machine down. Either way, at the next boot, a lengthy filesystem check using fsck is done. Fsck goes through the system and tries to recover any corrupt files that it finds. The result of this recovery operation is placed in this directory.

/media - Its dedicated directory for removable medias in newer systems

/mnt - This is a generic mount point under which you mount your filesystems or devices.

You can mount any of the removable drive or new partition under this point using command mount.

/opt - This directory is reserved for all the software and add-on packages that are not part of the default installation.

/proc - is very special in that it is also a virtual filesystem. Why?

Let's Inspect it.

Important Directories: /proc/bin/, /proc/net/

/root - This is the home directory of the System Administrator, 'root'.

 

/sbin - contains the important root related command files.

 

/usr - is shareable, read-only directory. That means that /usr directory is shareable between various FHS-compliant hosts and must not be written to. Any information that is host-specific or varies with time is stored elsewhere.

 

/tmp - for temporary files.

'Mountable' directories are: '/home', '/mnt', '/tmp', '/usr' and '/var'. Essential for booting are: '/bin', '/boot', '/dev', '/etc', '/lib', '/proc' and '/sbin'.

/var - Contains variable data like system logging files, mail and printer spool directories, and transient and temporary files. Some portions of /var are not shareable between different systems. For instance, /var/log, /var/lock, and /var/run. Other portions may be shared, notably /var/mail, /var/cache/man, /var/cache/fonts, and /var/spool/news.

Linux Security Fundamentals

Content

 

  • User Management
  • Privilege Management
  • Linux Permissions
  • Authentication PAM
  • Selinux

User Management

Authentication files

/etc/passwd : Stores users and properties related to users

/etc/shadow : Stores authentication properties specific to users

/etc/group : stores group as well as users in the secondary groups

/etc/security/opasswd : Stores old password used

Commands to manipulate files

  • useradd
  • userdel
  • usermod
  • passwd
  • groupadd
  • groupdel
  • groupmod

Privilege Management

Sudo is a program to control users access to run commands as privileged users (root).

VISUDO : Edit the sudoers file. Sudoers allows particular users to run various commands as the root, without needing the root password.

Linux Permissions

Unix permissions are limited to three categories for files and directories.

  • Owner
  • Group
  • Other or World

Following permissions are available.

  • Read : 4
  • Write : 2
  • Execute : 1

Access Control

Access Control provides an additional, more flexible permission mechanism for file systems. It is designed to assist with UNIX file permissions. ACL allows you to give permissions for any user or group to any disc resource.

File Attributes

  • Immutable : Can't change or delete the file even as root
  • Appendable : Can only add to the file

Pluggable Authentication Module

Linux Pluggable Authentication Modules (PAM) provide dynamic authentication support for applications and services in a linux.

E.g. Logging in, Setting up accounts etc.

Users can add the modules to change the behaviour of these.

Pam Groups

  • Auth
  • Account
  • Password
  • Session

Selinux

Security-Enhanced Linux (SELinux) is a Linux kernal security module that provides a mechanism for supporting access control security policies. It limits damage when other security layer failed. Selinux implements mandatory access control means anything if doesn't given explicit permission it will deny the services.

Modes

 

  • Off
  • Permissive
  • Enforcing

Any Questions ?

You can also mail us.

vijaykrishnavanshi@gmail.com

abhi.bundela1996@gmail.com

Thank You :)

Hello ?

By Vijay Krishnavanshi

Hello ?

  • 952