Linux Basics

Null Bangalore Puliya Session

20 February 2016

Slides

Abstract

We created a Repository to catalogue all details we discussed or found later in one place.
We will be covering following

Basic’s of linux file system hirarchy
Useful commands

VIM Editor Basics

Automating Routine Tasks

Interacting with other commands
overloading existing command to do more
writing shell scripts (Introduction)

AI Generated Summary

AI Generated Content Disclaimer

Note: This summary is AI-generated and may contain inaccuracies, errors, or omissions. If you spot any issues, please contact the site owner for corrections. Errors or omissions are unintended.

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

Notable Points

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”