Linux and developer tools
Bash Basics for Security Work
Learn pipes, redirection, variables, loops, exit codes and set -euo pipefail, then use them to count failed logins and hash a folder.
Create a GitHub account and a first repository in the browser, add a README and a second commit, and keep secrets out of it.
A GitHub repository is a folder that Git tracks. Every change to its files is saved as a commit, so you can read the history later and see what changed. This lesson shows how to create an account, make a repository, and make two commits, all in the browser. You need no programming background and no security tools.
Go to github.com and follow the sign-up flow on the site. Use a unique password, ideally stored in a password manager. Then turn on two-factor authentication in your account security settings. The official 2FA guide lists the available second-factor methods. SMS is only offered in some countries.
GitHub's layout changes over time. If a label below does not match your screen, use the Hello World guide as the reference.
Open the create menu in the upper-right corner and choose New repository. The official guide describes these fields:
., -, and _..gitignore, and license.Use the name security-learning-notes, add a short description, and choose Private while you learn. Tick the option to add a README, then create the repository.
Private visibility limits who can see the repository. That does not make it a safe place for passwords or keys, as section 6 explains.
Open README.md and click the pencil icon to edit it in the browser. Replace the contents with something specific:
# My Security Learning Notes
This repository contains exercises I created while learning cybersecurity.
## Topics
- How DNS works
- Encoding versus encryption
## Scope
All exercises use local labs or systems I own.Write a short message describing the change, such as Document learning goals, and commit it. A commit is a saved change with a message and a timestamp. GitHub stores it as part of the repository history.
Choose Add file, then Create new file. Type notes/first-lesson.md in the name field. Typing a slash creates a folder. In the body, write one paragraph explaining the difference between a password hash and encryption. A hash is a one-way fingerprint of data, used to check a value without storing the value itself. Encryption is reversible by anyone who holds the key. Commit this file with its own message, such as Add first lesson notes.
Separate commits make the history easier to read. Each commit should describe one idea.
Open the repository's commit history. You should see at least two commits with messages you can understand. Being able to explain what changed and why matters more than the number of commits.
If Git is installed on your computer, the same history is available from the command line. I ran this on a scratch repository with one commit using the same message:
git log --onelineOutput from that run:
03c208a Document learning goalsYour hash will differ. On Windows, Git may also print a warning about line endings during the first commit. The warning does not change the commit.
Before you upload any file, check it for .env files, access tokens, customer data, cloud credentials, and private logs. A .gitignore file tells Git to skip matching files, which helps prevent accidents. It does not remove a secret that was already committed, because the old commit stays in the history.
An example .gitignore for a learning project:
.env
*.pem
*.logIf you commit a secret by mistake, revoke or rotate it first. Once the secret is revoked or rotated, the old value can no longer grant access, so rewriting history may not be worth the effort. GitHub's guide on removing sensitive data covers both steps, including the side effects of a rewrite.
A web-based repository is useful for understanding structure and history. The next step is to learn what Git does on your own machine, then how git clone creates a local copy of a repository so you can work on it safely.
Keep only notes and exercises in this repository that you would be comfortable showing to anyone.
Linux and developer tools
Learn pipes, redirection, variables, loops, exit codes and set -euo pipefail, then use them to count failed logins and hash a folder.
Linux and developer tools
Linux owners, groups, rwx bits, chmod, umask and setuid, with a lab that tests access as a second user and finds risky file modes.
Linux and developer tools
How SSH host and user keys work, why Ed25519 with a passphrase is the default to use, and how to set up and harden a key login on a lab VM you own.