Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Linux presentation
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Wirker Dávid Zoltán
Linux presentation
Commits
78324558
Verified
Commit
78324558
authored
3 years ago
by
Tóth Miklós Tibor
Browse files
Options
Downloads
Patches
Plain Diff
Előadás done
parent
aae63cb3
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
eloadas.html
+283
-0
283 additions, 0 deletions
eloadas.html
eloadas.md
+46
-10
46 additions, 10 deletions
eloadas.md
hf.md
+1
-1
1 addition, 1 deletion
hf.md
with
330 additions
and
11 deletions
eloadas.html
0 → 100644
+
283
−
0
View file @
78324558
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"generator"
content=
"pandoc"
>
<meta
name=
"author"
content=
"Tóth Miklós"
>
<meta
name=
"dcterms.date"
content=
"2021-03-21"
>
<title>
Linux előadás
</title>
<meta
name=
"apple-mobile-web-app-capable"
content=
"yes"
>
<meta
name=
"apple-mobile-web-app-status-bar-style"
content=
"black-translucent"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui"
>
<link
rel=
"stylesheet"
href=
"https://unpkg.com/reveal.js@^4//dist/reset.css"
>
<link
rel=
"stylesheet"
href=
"https://unpkg.com/reveal.js@^4//dist/reveal.css"
>
<style>
code
{
white-space
:
pre-wrap
;}
span
.smallcaps
{
font-variant
:
small-caps
;}
span
.underline
{
text-decoration
:
underline
;}
div
.column
{
display
:
inline-block
;
vertical-align
:
top
;
width
:
50%
;}
div
.hanging-indent
{
margin-left
:
1.5em
;
text-indent
:
-1.5em
;}
ul
.task-list
{
list-style
:
none
;}
.display.math
{
display
:
block
;
text-align
:
center
;
margin
:
0.5rem
auto
;}
</style>
<link
rel=
"stylesheet"
href=
"https://unpkg.com/reveal.js@^4//dist/theme/black.css"
id=
"theme"
>
</head>
<body>
<div
class=
"reveal"
>
<div
class=
"slides"
>
<section
id=
"title-slide"
>
<h1
class=
"title"
>
Linux előadás
</h1>
<p
class=
"author"
>
Tóth Miklós
</p>
<p
class=
"date"
>
March 21, 2021
</p>
</section>
<section
id=
"pár-egyéb-hasznos-parancs"
class=
"slide level1"
>
<h1>
Pár egyéb hasznos parancs
</h1>
</section>
<section
id=
"wc"
class=
"slide level1"
>
<h1><code>
wc
</code></h1>
<ul>
<li>
word counter
</li>
<li>
szavak, sorok számolása
</li>
</ul>
<pre
class=
"shell-session"
><code>
[mike@thinkyboi ~]$ echo
"
egy két há
"
| wc -w
3
[mike@thinkyboi ~]$ echo
"
egy két há
"
| wc -l
1
[mike@thinkyboi ~]$ echo
"
egy
két
há
"
| wc -l
3
</code></pre>
</section>
<section
id=
"tr"
class=
"slide level1"
>
<h1><code>
tr
</code></h1>
<ul>
<li>
karaktereket cserél ki vagy töröl
</li>
</ul>
<pre
class=
"shell-session"
><code>
[mike@thinkyboi ~]$ echo
"
almafa
"
| tr
"
a
"
"
e
"
elmefe
[mike@thinkyboi ~]$ echo
"
almafa körtefa eperfa
"
| tr
"
"
"
\n
"
almafa
körtefa
eperfa
[mike@thinkyboi ~]$ echo
"
almafa
"
| tr -d
"
a
"
lmf
</code></pre>
</section>
<section
id=
"curl"
class=
"slide level1"
>
<h1><code>
curl
</code></h1>
<ul>
<li>
http shellből
</li>
<li>
stdout-ra írja ki, kivéve, ha van
<code>
-o
</code>
kapcsoló
</li>
</ul>
<pre
class=
"shell-session"
><code>
[mike@thinkyboi ~]$ curl https://home.sch.bme.hu/~mikewashere/linux/eloadas.md | grep stdout
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 777 100 777 0 0 33782 0 --:--:-- --:--:-- --:--:-- 33782
- stdout-ra írja ki
[mike@thinkyboi ~]$ curl https://home.sch.bme.hu/~mikewashere/linux/eloadas.md -o eloadas.md
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 777 100 777 0 0 31080 0 --:--:-- --:--:-- --:--:-- 31080
[mike@thinkyboi ~]$
</code></pre>
</section>
<section
id=
"sh-fileok"
class=
"slide level1"
>
<h1><code>
.sh
</code>
fileok
</h1>
<ul>
<li>
shell automatizálása
</li>
<li>
mintha soronként kiadnánk a parancsokat
</li>
</ul>
</section>
<section
id=
"egy-.sh-file"
class=
"slide level1"
>
<h1>
egy
<code>
.sh
</code>
file
</h1>
<pre
class=
"shell-session"
><code>
[mike@thinkyboi tmp]$ vi test.sh
[mike@thinkyboi tmp]$ cat test.sh
echo
"
ez simán működik
"
| cowsay
curl
"
https://home.sch.bme.hu/~mikewashere/linux/eloadas.md
"
| grep
"
soronként
"
| cowsay
[mike@thinkyboi tmp]$ bash test.sh
_____________________
<
ez simán működik
>
---------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1596 100 1596 0 0 69391 0 --:--:-- --:--:-- --:--:-- 69391
_________________________________
/ - mintha soronként kiadnánk a \
\ parancsokat /
---------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
[mike@thinkyboi tmp]$
</code></pre>
</section>
<section
id=
"shebang"
class=
"slide level1"
>
<h1>
shebang
</h1>
<ul>
<li>
file futtatásakor a kernel meglesi mi van az elején
</li>
<li>
el tudunk indítani scripteket programként
</li>
<li><code>
#!
<
program
>
</code></li>
</ul>
</section>
<section
id=
"shebang-1"
class=
"slide level1"
>
<h1>
shebang
</h1>
<pre
class=
"shell-session"
><code>
[mike@thinkyboi tmp]$ vi test.sh
[mike@thinkyboi tmp]$ cat test.sh
#!/bin/bash
echo
"
ez simán működik
"
| cowsay
curl
"
https://home.sch.bme.hu/~mikewashere/linux/eloadas.md
"
| grep
"
soronként
"
| cowsay
[mike@thinkyboi tmp]$ chmod +x test.sh
[mike@thinkyboi tmp]$ ./test.sh
_____________________
<
ez simán működik
>
---------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1596 100 1596 0 0 11319 0 --:--:-- --:--:-- --:--:-- 11319
_________________________________
/ - mintha soronként kiadnánk a \
\ parancsokat /
---------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
[mike@thinkyboi tmp]$
</code></pre>
</section>
<section
id=
"tűzfal"
class=
"slide level1"
>
<h1>
tűzfal
</h1>
<ul>
<li>
a kernel belsejében -
>
gyors, de low-level
</li>
<li>
iptables
</li>
<li>
kényelmesebb egy tűzfal-kezelő
</li>
</ul>
</section>
<section
id=
"ufw"
class=
"slide level1"
>
<h1>
UFW
</h1>
<ul>
<li>
uncomplicated firewall
</li>
<li>
egyszerű
</li>
</ul>
<pre
class=
"shell-session"
><code>
[mike@thinkyboi tmp]$ sudo ufw allow 80
Rules updated
Rules updated (v6)
[mike@thinkyboi tmp]$ sudo ufw allow https
Rules updated
Rules updated (v6)
[mike@thinkyboi tmp]$ sudo ufw enable
</code></pre>
</section>
<section
id=
"ssh-kulcsok"
class=
"slide level1"
>
<h1>
SSH kulcsok
</h1>
<ul>
<li>
biztonságosabb, mint egy jelszó
</li>
<li>
sok algoritmus, RSA, elliptikus görbék
</li>
<li>
publikus-privát
</li>
<li>
privát saját gépen, védve
</li>
<li>
publikus ott, ahova belépnénk
</li>
<li><code>
~/.ssh/authorized_keys
</code></li>
</ul>
</section>
<section
id=
"generálás"
class=
"slide level1"
>
<h1>
Generálás
</h1>
<pre
class=
"shell-session"
><code>
mike@thinkyboi:~$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/mike/.ssh/id_rsa):
Created directory
'
/home/mike/.ssh
'
.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/mike/.ssh/id_rsa
Your public key has been saved in /home/mike/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:tYZX08XEZfJP5j/um2Y9KUgG+jffe82ONwgzkt4p0hc mike@thinkyboi
The key
'
s randomart image is:
+---[RSA 3072]----+
| .+*|
| . =o|
| . o . +|
| + o . +.|
| S * o|
| . = E .|
| + = B .o=|
| . = B ooBO|
| . + o.*XB|
+----[SHA256]-----+
mike@thinkyboi:~$ cat .ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDjAZMAbpNutuc/ZgHWMcjWcPQOC0d8+JrDaHMnxZfRtfdyrgZDfPmMER95148JVEfkjjhur8a+IEfQM59o+yq95+yNvJFT6Nr5JzHK8dC5IuDvvEVNrKPwmW4UIgm1e5b95pGivJ5cnoiXevtp87seaxh0DlZFONKUeIFnwyDBUII7mRyXDn7MrFlAcxXtlZnSSCXXLGUMZI7nldiyRI9gXlZYCpfA8XrXrnM6JAIA+6VozhJurAKhygV6rH5yD4Vg+/Bs+wigywE3U79gbqpPzRegmxzKdgv+NNKV900DQVYNzvCU5o6q9d2amU+CDSw6KjU+4SLFOgZ3myXCyE9er3aaROj22sQdPwv8CnwtZstRibpp2SU627J4Vr7caPl8wrZcGvmXgD50mPh9Kdd+Yr5WJFSaAcog082aWBdrB3Qr9LM5DgcWulyDmUMmjA2WWCJN+t6vDT5d+2mYeBiZ2OY5ZkHyUjD6GVGBOZP/lP9EAxi3XwoM3V8TwoEgLD8= mike@thinkyboi
mike@thinkyboi:~$
</code></pre>
</section>
<section
id=
"operátor"
class=
"slide level1"
>
<h1><code>
>>
</code>
operátor
</h1>
<ul>
<li><code>
>
</code>
tesója
</li>
<li>
filehoz appendál
</li>
</ul>
<pre
class=
"shell"
><code>
curl https://git.sch.bme.hu/mikewashere.keys
>>
~/.ssh/authorized_keys
</code></pre>
</section>
<section
id=
"házi-feladatok"
class=
"slide level1"
>
<h1>
Házi Feladatok
</h1>
</section>
<section
id=
"alap-házi"
class=
"slide level1"
>
<h1>
Alap házi
</h1>
<p>
Csinálj felhasználót a csapattársaidnak a VM-edre úgy, hogy hozzáférjenek a statikus weboldalak mappájához, ezután próbáljátok ki, hogy valóban hozzáfértek-e és ha igen, rakjatok valami funky html-t a mappánba ajándékba a társaitoknak.
</p>
<p>
Hint: adduser/useradd, usermod/gpasswd, chmod.
</p>
</section>
<section
id=
"side-quest"
class=
"slide level1"
>
<h1>
Side Quest
</h1>
<p>
Állíts be kulcsos hitelesítést a képzés VM-eden az SSH kapcsolatodhoz. Ehhez szükséged lesz egy privát és egy publikus kulcsra a kliensgépeden.
</p>
<p>
Hint: ssh-keygen.
</p>
</section>
<section
id=
"expert-sudo"
class=
"slide level1"
>
<h1>
Expert (sudo)
</h1>
<p>
Nyomozz hogyan és miért műküdik a sudo parancs! Ha megtaláltad próbáld meg összefoglalni nekünk néhány mondatban.
</p>
<p>
Hint: setuid
</p>
</section>
<section
id=
"expert-csomag-mágus"
class=
"slide level1"
>
<h1>
Expert (Csomag mágus)
</h1>
<p>
Készíts egy új csomagot (package) egy általad válaszott programból (saját program is lehet), egy általad választott disztribúcióhoz.
</p>
</section>
<section
id=
"jó-munkát"
class=
"slide level1"
>
<h1>
Jó munkát
</h1>
</section>
</div>
</div>
<script
src=
"https://unpkg.com/reveal.js@^4//dist/reveal.js"
></script>
// reveal.js plugins
<script
src=
"https://unpkg.com/reveal.js@^4//plugin/notes/notes.js"
></script>
<script
src=
"https://unpkg.com/reveal.js@^4//plugin/search/search.js"
></script>
<script
src=
"https://unpkg.com/reveal.js@^4//plugin/zoom/zoom.js"
></script>
<script>
// Full list of configuration options available at:
// https://revealjs.com/config/
Reveal
.
initialize
({
// Push each slide change to the browser history
history
:
true
,
// reveal.js plugins
plugins
:
[
RevealNotes
,
RevealSearch
,
RevealZoom
]
});
</script>
</body>
</html>
This diff is collapsed.
Click to expand it.
eloadas.md
+
46
−
10
View file @
78324558
...
...
@@ -4,7 +4,7 @@
# Pár egyéb hasznos parancs
#
# `wc`
# `wc`
-
word counter
-
szavak, sorok számolása
...
...
@@ -20,7 +20,7 @@ há" | wc -l
3
```
#
# `tr`
# `tr`
-
karaktereket cserél ki vagy töröl
...
...
@@ -35,7 +35,7 @@ eperfa
lmf
```
#
# `curl`
# `curl`
-
http shellből
-
stdout-ra írja ki, kivéve, ha van
`-o`
kapcsoló
...
...
@@ -58,6 +58,8 @@ lmf
-
shell automatizálása
-
mintha soronként kiadnánk a parancsokat
# egy `.sh` file
```
shell-session
[mike@thinkyboi tmp]$
vi test.sh
[mike@thinkyboi tmp]$
cat
test.sh
...
...
@@ -94,6 +96,8 @@ curl "https://home.sch.bme.hu/~mikewashere/linux/eloadas.md" | grep "soronként"
-
el tudunk indítani scripteket programként
-
`#!<program>`
# shebang
```
shell-session
[mike@thinkyboi tmp]$
vi test.sh
[mike@thinkyboi tmp]$
cat
test.sh
...
...
@@ -132,7 +136,7 @@ curl "https://home.sch.bme.hu/~mikewashere/linux/eloadas.md" | grep "soronként"
-
iptables
-
kényelmesebb egy tűzfal-kezelő
#
# UFW
# UFW
-
uncomplicated firewall
-
egyszerű
...
...
@@ -156,10 +160,10 @@ Rules updated (v6)
-
publikus ott, ahova belépnénk
-
`~/.ssh/authorized_keys`
#
# Generálás
# Generálás
```
shell-session
mike@
🔥
:~$
ssh-keygen
mike@
thinkyboi
:~$
ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/mike/.ssh/id_rsa):
Created directory '/home/mike/.ssh'.
...
...
@@ -168,7 +172,7 @@ Enter same passphrase again:
Your identification has been saved in /home/mike/.ssh/id_rsa
Your public key has been saved in /home/mike/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:tYZX08XEZfJP5j/um2Y9KUgG+jffe82ONwgzkt4p0hc mike@
🔥
SHA256:tYZX08XEZfJP5j/um2Y9KUgG+jffe82ONwgzkt4p0hc mike@
thinkyboi
The key's randomart image is:
+---[RSA 3072]----+
| .+*|
...
...
@@ -181,9 +185,9 @@ The key's randomart image is:
| . = B ooBO|
| . + o.*XB|
+----[SHA256]-----+
mike@
🔥
:~$
cat
.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDjAZMAbpNutuc/ZgHWMcjWcPQOC0d8+JrDaHMnxZfRtfdyrgZDfPmMER95148JVEfkjjhur8a+IEfQM59o+yq95+yNvJFT6Nr5JzHK8dC5IuDvvEVNrKPwmW4UIgm1e5b95pGivJ5cnoiXevtp87seaxh0DlZFONKUeIFnwyDBUII7mRyXDn7MrFlAcxXtlZnSSCXXLGUMZI7nldiyRI9gXlZYCpfA8XrXrnM6JAIA+6VozhJurAKhygV6rH5yD4Vg+/Bs+wigywE3U79gbqpPzRegmxzKdgv+NNKV900DQVYNzvCU5o6q9d2amU+CDSw6KjU+4SLFOgZ3myXCyE9er3aaROj22sQdPwv8CnwtZstRibpp2SU627J4Vr7caPl8wrZcGvmXgD50mPh9Kdd+Yr5WJFSaAcog082aWBdrB3Qr9LM5DgcWulyDmUMmjA2WWCJN+t6vDT5d+2mYeBiZ2OY5ZkHyUjD6GVGBOZP/lP9EAxi3XwoM3V8TwoEgLD8= mike@
🔥
mike@
🔥
:~$
mike@
thinkyboi
:~$
cat
.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDjAZMAbpNutuc/ZgHWMcjWcPQOC0d8+JrDaHMnxZfRtfdyrgZDfPmMER95148JVEfkjjhur8a+IEfQM59o+yq95+yNvJFT6Nr5JzHK8dC5IuDvvEVNrKPwmW4UIgm1e5b95pGivJ5cnoiXevtp87seaxh0DlZFONKUeIFnwyDBUII7mRyXDn7MrFlAcxXtlZnSSCXXLGUMZI7nldiyRI9gXlZYCpfA8XrXrnM6JAIA+6VozhJurAKhygV6rH5yD4Vg+/Bs+wigywE3U79gbqpPzRegmxzKdgv+NNKV900DQVYNzvCU5o6q9d2amU+CDSw6KjU+4SLFOgZ3myXCyE9er3aaROj22sQdPwv8CnwtZstRibpp2SU627J4Vr7caPl8wrZcGvmXgD50mPh9Kdd+Yr5WJFSaAcog082aWBdrB3Qr9LM5DgcWulyDmUMmjA2WWCJN+t6vDT5d+2mYeBiZ2OY5ZkHyUjD6GVGBOZP/lP9EAxi3XwoM3V8TwoEgLD8= mike@
thinkyboi
mike@
thinkyboi
:~$
```
# `>>` operátor
...
...
@@ -193,3 +197,35 @@ mike@🔥:~$
```
shell
curl https://git.sch.bme.hu/mikewashere.keys
>>
~/.ssh/authorized_keys
```
# Házi Feladatok
# Alap házi
Csinálj felhasználót a csapattársaidnak a VM-edre úgy, hogy
hozzáférjenek a statikus weboldalak mappájához,
ezután próbáljátok ki, hogy valóban hozzáfértek-e
és ha igen, rakjatok valami funky html-t a mappánba ajándékba a társaitoknak.
Hint: adduser/useradd, usermod/gpasswd, chmod.
# Side Quest
Állíts be kulcsos hitelesítést a képzés VM-eden az SSH kapcsolatodhoz.
Ehhez szükséged lesz egy privát és egy publikus kulcsra a kliensgépeden.
Hint: ssh-keygen.
# Expert (sudo)
Nyomozz hogyan és miért műküdik a sudo parancs!
Ha megtaláltad próbáld meg összefoglalni nekünk néhány mondatban.
Hint: setuid
# Expert (Csomag mágus)
Készíts egy új csomagot (package) egy általad válaszott programból
(saját program is lehet), egy általad választott disztribúcióhoz.
# Jó munkát
This diff is collapsed.
Click to expand it.
hf.md
+
1
−
1
View file @
78324558
...
...
@@ -26,4 +26,4 @@ Hint: setuid
## Expert (Csomag mágus)
Készíts egy új csomagot (package) egy általad válaszott programból
(saját program is lehet), egy általad választott disztribúcióhoz.
\ No newline at end of file
(saját program is lehet), egy általad választott disztribúcióhoz.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment