The “Linux Puliya” session at a Null Meet Bangalore Puliya meetup provides a foundational introduction to Linux for security professionals. It works as a hands-on primer covering the Unix/Linux family tree, filesystem basics, essential commands, standard I/O, shell scripting, SSH configuration, and task automation with cron, with topics picked for security practitioners such as file permissions and privilege escalation concepts.
Summary
The session opened by placing Linux inside the wider *nix family alongside Unix and the BSD variants (FreeBSD, OpenBSD and more), all of which follow common standards for filesystems and directory layout. Linux is free as in free speech, not free beer, and anyone can create their own distribution, from serious enterprise distros to novelty ones like Hannah Montana Linux. The distribution discussion split Debian based systems (apt-get, dpkg) from RedHat based ones (yum, rpm) and flagged the LTS versus rolling release question when picking a stable platform.
Filesystem basics followed the “everything is a file” principle: / as the highest level, /etc for all configuration, /home for user folders. The deck walked through ext2 (16 GB to 2 TB files, 2 TB to 32 TB filesystems), ext3 (journaling, kernel 2.4.15), and ext4 (kernel 2.6.19, files up to 16 TB, filesystems up to 1 EB, with 1 EB equalling 1024 PB). Permissions got a full treatment: standard -rwxrwxrwx, SUID (-rwsrwxrwx), SGID (-rwxrwsrwx), the sticky bit (-rwxrwxrwt), and first-character file types (l, c, b, d, -), all framed as critical background for privilege escalation in security assessments. On privilege management, uid 0 is omnipotent, so the recommendation was to avoid using root directly and use sudo for auditable privilege escalation.
Standard I/O redirection (input <, output >, error 2>) bridged into the command coverage: ls, cd, mkdir for navigation; cut, grep, sed, sort, uniq for text processing; xargs and find for batch operations; plus tr, ps, screen, netstat -lntp, and file. Editors covered were Vim, Nano, and Emacs, including the classic problem of how to exit Vim. Software installation was shown across ecosystems with apt-get install, yum install, pip install, gem install, and npm install. A tricks slide added python -m SimpleHTTPServer, !! to repeat the last command, cd ~ and cd - for directory navigation, mtr for network diagnostics, mount and format operations, and environment variable management.
The closing sections covered crontab and its six-field format (minute, hour, day of month, month, day of week, year) for automating periodic execution, SSH configuration through /etc/ssh/sshd_config with key-based authentication via ~/.ssh/authorized_keys preferred over passwords, and shell scripting fundamentals: shebang lines, positional parameters ($1, $2, $*, $@, $0), read, echo, cat, conditions, loops, and brace expansion. Attendees then wrote custom scripts to calculate simple interest, check even or odd numbers, and print prime numbers from 1 to 5000. The last topic was overloading commands with alias, and when modifying PATH to shadow default commands is the better route. The session closed with questions.
Key Themes
- *Understanding nix systems: Unix, Linux, and BSD variants (FreeBSD, OpenBSD and more) share common standards for filesystem layout and directory structure. Linux is free and open source, and anyone can create their own distribution, from enterprise offerings to novelty ones like Hannah Montana Linux.
- Linux distributions: Debian based systems use
apt-get/dpkg and RedHat based systems use yum/rpm. The LTS versus rolling release distinction matters when choosing a stable security testing platform.
- Filesystem basics: “Everything is a file” underpins the entire system. The standard layout starts at
/ with /etc for configuration and /home for user directories, and the covered filesystem types are ext2, ext3 (journaling, introduced in kernel 2.4.15), and ext4 (from kernel 2.6.19, files up to 16 TB and filesystems up to 1 EB).
- File permissions and special bits: Standard Unix permissions (
-rwxrwxrwx), SUID (-rwsrwxrwx), SGID (-rwxrwsrwx), and the sticky bit (-rwxrwxrwt), with the first character indicating file type (l symlink, c character device, b block device, d directory, - regular file). These concepts are critical for understanding privilege escalation in security assessments.
- Sudo and privilege management: UID 0 (root) is omnipotent in Linux. Best practice is to avoid using root directly and use
sudo for elevated operations, enabling auditable privilege escalation.
- Standard I/O and essential commands: Input (
<), output (>), and error (2>) redirection are essential for scripting and log management. The daily command set spans navigation (ls, cd, mkdir), text processing (cut, grep, sed, sort, uniq), batch operations (xargs, find), tr, ps, screen, netstat -lntp, and file.
- Text editors and software installation: Vim, Nano, and Emacs, including the classic challenge of how to exit Vim. Package management across ecosystems:
apt-get install (Debian), yum install (RedHat), pip install (Python), gem install (Ruby), npm install (Node.js).
- Useful tricks: Quick HTTP server with
python -m SimpleHTTPServer, !! to repeat the last command, cd ~ and cd - for directory navigation, mtr for network diagnostics, mount and format operations, and environment variable management.
- Crontab, SSH, and shell scripting: Crontab schedules periodic tasks with a six-field format (minute, hour, day of month, month, day of week, year), essential for automating security scans, log rotation, and maintenance. SSH configuration via
/etc/ssh/sshd_config and key-based authentication using ~/.ssh/authorized_keys carries security advantages over password authentication. Scripting covers shebang lines, positional parameters, read for input, echo and cat for output, conditionals, loops, and brace expansion.
- Command overloading with aliases:
alias customizes commands; the deck weighs when aliases are appropriate versus modifying PATH to overload default commands.
Notable Points
- The text processing pipeline (
grep, sed, sort, uniq, cut, xargs) forms the backbone of log analysis, data extraction, and security scripting on Linux systems.
- SSH key-based authentication with password login disabled on managed servers is a baseline security practice that eliminates brute-force password attacks.
- SUID and SGID bits are common vectors for privilege escalation in penetration testing engagements.
crontab automates recurring security tasks such as vulnerability scans, log collection, and backup verification instead of manual execution.
- Use
sudo for privileged operations rather than logging in as root, and keep netstat -lntp handy for quickly auditing open ports and listening services.
- Scripting fluency starts with the session’s exercises: simple interest calculation, even/odd checking, and prime numbers from 1 to 5000.
- ext3 journaling arrived in Linux kernel 2.4.15; ext4 followed from kernel 2.6.19 with a 16 TB maximum file size and 1 EB filesystem support.
python -m SimpleHTTPServer stands up a quick HTTP server for serving files during testing.
Notable Quotes
“Free as in free speech not free beer”
“Everything is a file”
“id 0 is omnipotent”
“Write a shell script to calculate simple interest”
“Print prime numbers from 1 to 5000”