forked from victorbrca/rhcsa-study-guide
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9999708
commit 21e8d07
Showing
122 changed files
with
8,181 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
name: Request to add new content | ||
about: Add content via Git Hub issues | ||
title: "[NEW]" | ||
labels: documentation, enhancement | ||
assignees: '' | ||
|
||
--- | ||
|
||
## New Content | ||
|
||
<!-- Add the objective that the changes should go to. Eg: '1. Understand and use essential tools'--> | ||
**Objective:** | ||
|
||
<!-- Add the page that should be updated with the new content. Eg: '1f-Archive-compress-unpack-and-uncompress-files-using-tar-star-gzip-and-bzip2.md'--> | ||
**Page:** | ||
|
||
<!-- Add a quick description for the changes your are proposing --> | ||
**Description:** | ||
|
||
<!-- If possible, add backup sources to confirm the validity of your changes --> | ||
**Backup sources:** | ||
|
||
--- | ||
<!-- Add the new content below (keep it between the lines)--> | ||
**New content:** | ||
|
||
|
||
|
||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
name: Request to change documentation | ||
about: Make changes to content via Git Hub issues | ||
title: "[CHANGE]" | ||
labels: documentation, enhancement | ||
assignees: '' | ||
|
||
--- | ||
|
||
## Current Content | ||
|
||
<!-- Add the objective that needs to be modified. Eg: '1. Understand and use essential tools'--> | ||
**Objective:** | ||
|
||
<!-- Please add the page that needs to be modified. Eg: '1f-Archive-compress-unpack-and-uncompress-files-using-tar-star-gzip-and-bzip2.md'--> | ||
**Page name:** | ||
|
||
--- | ||
<!-- Add below the current block of text/content that needs to be modified (keep it between the lines)--> | ||
**Current content:** | ||
|
||
|
||
--- | ||
## New Content | ||
|
||
<!-- Add a quick description for the changes your are proposing --> | ||
**Description:** | ||
|
||
<!-- If possible, add backup sources to confirm the validity of your changes --> | ||
**Backup sources:** | ||
|
||
--- | ||
<!-- Add the new content below (keep it between the lines)--> | ||
**New content:** | ||
|
||
|
||
|
||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,41 @@ | ||
# rhcsa-study-guide | ||
RHCSA Community Study Guide | ||
# RHCSA Community Study Guide | ||
|
||
This repo serves as a community study guide for anyone that wants to study for the RHCSA exam. The idea is that anyone preparing for the exam can use the information here, as well as contribute (add, update, correct) to make it better. The aim is to have a free and Open Source study guide that is always up to date and with the best content. | ||
|
||
Please adhere to the guidelines, and most importantly, Red Hat's NDA. | ||
|
||
**Current Version:** RHCSA v8 _(with container objectives)_ | ||
|
||
## How to use | ||
|
||
As a study guide it makes more sense to digest the content via your web browser. You can access it at the [Objectives](markdown/Objectives.md) page. | ||
|
||
If you want to edit the content, start by reviewing the [rules](markdown/Rules.md). After you can choose to edit the contents by following the proper procedure for contributing changes to a Git Hub repository (if you are not familiar with the Git Hub process you can find simple instructions [here](https://kbroman.org/github_tutorial/pages/fork.html)), or by creating a Git Hub [issue](https://github.com/victorbrca/rhcsa-study-guide/issues/new/choose). | ||
|
||
### Rules and FAQ | ||
|
||
Please review the rules before making any changes. | ||
|
||
[Rules](markdown/Rules.md) | ||
|
||
## Study Content | ||
|
||
This is where you will be able to find various information about the exam, study guide, labs, study environments, etc. | ||
|
||
### Exam Format | ||
|
||
The exam format for the current version of the exam. | ||
|
||
[Exam Format](markdown/Exam-Format.md) | ||
|
||
### Objectives | ||
|
||
The current objectives for the exam (in enumerated list). This is where you can access the study guide's content. | ||
|
||
[Objectives](markdown/Objectives.md) | ||
|
||
### Additional Resources | ||
|
||
This page will provide you additional resources that will greatly help with your study. Resources include instructional videos, environments, labs and much more. | ||
|
||
[Additional Resources](markdown/Additional-Resources.md) |
16 changes: 16 additions & 0 deletions
16
...wn/1-Understand-and-use-essential-tools/1-Understand-and-use-essential-tools.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
### 1. Understand and use essential tools | ||
|
||
+ [1.a Access a shell prompt and issue commands with correct syntax](1a-Access-a-shell-prompt-and-issue-commands-with-correct-syntax.md) | ||
+ [1.b Use input-output redirection (>, >>, |, 2>, etc.)](1b-Use-input-output-redirection.md) | ||
+ [1.c Use grep and regular expressions to analyze text](1c-Use-grep-and-regular-expressions-to-analyze-text.md) | ||
+ [1.d Access remote systems using SSH](1d-Access-remote-systems-using-SSH.md) | ||
+ [1.e Log in and switch users in multiuser targets](1e-Log-in-and-switch-users-in-multiuser-targets.md) | ||
+ [1.f Archive, compress, unpack, and uncompress files using tar, star, gzip, and bzip2](1f-Archive-compress-unpack-and-uncompress-files-using-tar-star-gzip-and-bzip2.md) | ||
+ [1.g Create and edit text files](1g-Create-and-edit-text-files.md) | ||
+ [1.h Create, delete, copy, and move files and directories](1h-Create-delete-copy-and-move-files-and-directories.md) | ||
+ [1.i Create hard and soft links](1i-Create-hard-and-soft-links.md) | ||
+ [1.j List, set, and change standard ugo/rwx permissions](1j-List-set-and-change-standard-ugo_rwx-permissions.md) | ||
+ [1.k Locate, read, and use system documentation including man, info, and files in /usr/share/doc](1k-Locate-read-and-use-system-documentation-including-man-info-and-files-in-_usr_share_doc.md) | ||
|
||
--- | ||
[⬅️ Back](../Objectives.md) |
10 changes: 10 additions & 0 deletions
10
...ential-tools/1a-Access-a-shell-prompt-and-issue-commands-with-correct-syntax.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
1.a Access a shell prompt and issue commands with correct syntax | ||
=== | ||
|
||
You should know: | ||
+ How to open the terminal | ||
+ Execute very basic commands (pwd, ls, cd, mv, man) | ||
|
||
|
||
--- | ||
[⬅️ Back](1-Understand-and-use-essential-tools.md) |
59 changes: 59 additions & 0 deletions
59
markdown/1-Understand-and-use-essential-tools/1b-Use-input-output-redirection.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
1.b Use input-output redirection (>, >>, |, 2>, etc.) | ||
=== | ||
|
||
stdin, stdout, stderr | ||
--- | ||
|
||
Under normal circumstances every Linux program has three streams opened when it starts; one for input; one for output; and one for printing diagnostic or error messages. These are typically attached to the user's terminal (see man tty(4)) but might instead refer to files or other devices, depending on what the parent process chose to set up. | ||
|
||
+ stdin (0) - Keyboard | ||
+ stdout (1) - Screen | ||
+ stderr (2) - Device reserved for error output | ||
|
||
|
||
Input Redirection | ||
--- | ||
|
||
Redirection is used to redirect the stdout/stdin/stderr. | ||
|
||
| Operator | Redirect | | ||
| ------------ |:----------------- | | ||
| `1>`, `>` | stdout | | ||
| `1>>`, `>>` | Append stdout | | ||
| `2>`, | stderr | | ||
| `2>>` | Append stderr | | ||
| * `2>&1`, `&>` | stderr and stdout | | ||
|
||
\* *Here are two ways on how we would redirect stderr to stdout* | ||
|
||
command > output_file 2>&1 | ||
#or | ||
command &> output_file | ||
|
||
### Examples | ||
|
||
Cat the contents of myfirstscript (same as `cat myfirstscript`) | ||
|
||
$ cat < myfirstscript | ||
|
||
Create longlisting with the output of `ls -al myfirstscript` | ||
|
||
$ ls -al myfirstscript > longlisting | ||
|
||
Copy the contents of myfirstscript to mynewscript | ||
|
||
$ cat < myfirstscript > mynewscript | ||
|
||
Pipe | ||
--- | ||
|
||
Pipes are used to give the output of a command as input to another command | ||
|
||
$ echo a b c | cut -f 2 -d ' ' | ||
b | ||
|
||
|
||
|
||
|
||
--- | ||
[⬅️ Back](1-Understand-and-use-essential-tools.md) |
30 changes: 30 additions & 0 deletions
30
...-and-use-essential-tools/1c-Use-grep-and-regular-expressions-to-analyze-text.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
1.c Use grep and regular expressions to analyze text | ||
=== | ||
|
||
| Operator | Description | | ||
| --------------- | --------------------------------------------------------------------------- | | ||
| `^` | Match expr at the start of line | | ||
| `$` | Match expr at the end of line | | ||
| `\` | Turn off special meaning | | ||
| `[ ]` | Match any of the enclosed chars | | ||
| `[^ ]` | Match any char except the enclosed | | ||
| `.` | Match a single char | | ||
| `?` | Match zero or one chars | | ||
| `+` | Match one or more chars | | ||
| `*` | Match zero or more chars | | ||
| `\{x,y\}` | Match x to y occurrences of preceding expr | | ||
| `\{x\}` | Match x occurrences of preceding expr | | ||
| `\{x,\}` | Match x or more occurrences of preceding expr | | ||
| `[:class:]` | Matches all chars in class (alnum, alpha, digit, space, upper, lower, etc.) | | ||
|
||
#### Character Classes | ||
|
||
`[:alnum:], [:alpha:], [:cntrl:], [:digit:], [:graph:], [:lower:], [:print:], [:punct:], [:space:], [:upper:], and [:xdigit:]` | ||
|
||
**📌 EXAM TIP** | ||
+ Use `man 7 regex` to get information on regex | ||
+ You can find the character classes in grep's man page | ||
+ Almost all character classes are defined with a 5 character word | ||
|
||
--- | ||
[⬅️ Back](1-Understand-and-use-essential-tools.md) |
73 changes: 73 additions & 0 deletions
73
...down/1-Understand-and-use-essential-tools/1d-Access-remote-systems-using-SSH.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
1.d Access remote systems using SSH | ||
=== | ||
|
||
## The SSH protocol | ||
|
||
The SSH protocol uses encryption to secure the connection between a client and a server. All user authentication, commands, output, and file transfers are encrypted to protect against attacks in the network. | ||
|
||
 | ||
|
||
The new protocol replaced several legacy tools and protocols, including telnet, ftp, FTP/S, rlogin, rsh, and rcp. | ||
|
||
**Old Technologies that the SSH stack replaces** | ||
+ Telnet -> SSH | ||
+ RCP -> SCP | ||
+ FTP -> SFTP | ||
|
||
## Usage | ||
|
||
SSH is typically used to log into a remote machine and execute commands, but it also can transfer files using the associated SSH file transfer (SFTP) or secure copy (SCP) protocols. SSH uses the client-server model. | ||
|
||
### Basic Syntax | ||
|
||
To connect to a remote system using SSH, we’ll use the ssh command. The most basic form of the command is: | ||
|
||
ssh remote_host | ||
|
||
The remote_host in this example is the IP address or domain name that you are trying to connect to. | ||
|
||
This command assumes that your username on the remote system is the same as your username on your local system. | ||
|
||
If your username is different on the remote system, you can specify it by using this syntax: | ||
|
||
ssh remote_username@remote_host | ||
|
||
Once you have connected to the server, you may be asked to verify your identity by providing a password. | ||
|
||
**Important command flags/options** | ||
+ `-l` - login | ||
+ `-i` - specify a private key to use | ||
+ `-F` - specify config file | ||
+ `-X` - enable X forwarding | ||
|
||
### Configuration Files | ||
|
||
**Client Config files** | ||
+ `~/.ssh/config` | ||
+ `/etc/ssh/ssh_config` | ||
|
||
**Server config file** | ||
+ `/etc/ssh/sshd_config` | ||
|
||
## Other Important SSH Commands | ||
|
||
We will review these later. | ||
|
||
+ `ssh-keygen` | ||
+ `ssh-copy-id` *(note that this is a script and not a binary)* | ||
|
||
## How to enable commonly used config | ||
|
||
The listed configuration is done at the server: `/etc/ssh/sshd_config`. | ||
|
||
+ X11 forwarding | ||
+ `X11Forwarding yes` | ||
+ sftp subsytem | ||
+ `Subsystem sftp /usr/lib/ssh/sftp-server` | ||
+ Root login | ||
+ `PermitRootLogin yes` | ||
+ Password authentication | ||
+ `PasswordAuthentication yes` | ||
|
||
--- | ||
[⬅️ Back](1-Understand-and-use-essential-tools.md) |
Binary file added
BIN
+32.9 KB
...1d-Access-remote-systems-using-SSH/1d-Access-remote-systems-using-SSH-c3524.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 53 additions & 0 deletions
53
...tand-and-use-essential-tools/1e-Log-in-and-switch-users-in-multiuser-targets.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
1.e Log in and switch users in multiuser targets | ||
=== | ||
|
||
## Understanding Sell Types | ||
|
||
**Login Shells** | ||
|
||
A login shell (also an interactive shell) is the first process that executes under your user ID when you log in for an interactive session. | ||
|
||
Bash runs the following scripts on login: | ||
|
||
* /etc/profile | ||
* The first found of ~/.bash_profile, ~/.bash_login, ~/.profile | ||
|
||
**Interactive Shells** | ||
|
||
An interactive shell reads commands from user input on a tty. Among other things, such a shell reads startup files on activation, displays a prompt, and enables job control by default. The user can interact with the shell. On entering an interactive terminal, Bash also executes: | ||
|
||
* /etc/bash.bashrc | ||
* ~/.bashrc | ||
|
||
**Non-interactive shells** | ||
|
||
Non-interactive shells do not usually execute startup files, however different shells act differently. Bash always reads `~/.bashrc` when its invoked by rshd or sshd, even if its not interactive (but not if its called as sh). Zsh always reads `~/.zshenv`. | ||
|
||
Also note that aliases are not expanded when the shell is not interactive, unless the expand_aliases shell option is set using shopt: | ||
|
||
## Changing Users | ||
|
||
**Commands:** | ||
- su (1) - run a command with substitute user and group ID | ||
- sudo (8) - execute a command as another user | ||
|
||
_**Sudo and su commands and shell type**_ | ||
|
||
| Command | Interactive | Login | | ||
| --------------- | ----------- | ----- | | ||
| `su` | Y | N | | ||
| `su -`, `su -l` | Y | Y | | ||
| `sudo -i` | Y | Y | | ||
|
||
**su vs sudo** | ||
+ sudo - asks for user password | ||
+ su - asks for user password | ||
|
||
**Files to know** | ||
+ `~/.bash_history` | ||
+ `~/.bash_logout` | ||
+ `~/.bashrc` | ||
+ `~/.bash_profile` | ||
|
||
--- | ||
[⬅️ Back](1-Understand-and-use-essential-tools.md) |
Oops, something went wrong.