diff --git a/eloadas.md b/eloadas.md index 318cd0f2cc8ec514500c3dfa99294473884901da..4e477d04a1b5bb2da8a9afa9b023bd9ee57cb0ab 100644 --- a/eloadas.md +++ b/eloadas.md @@ -65,3 +65,95 @@ curl https://git.sch.bme.hu/mikewashere.keys >> .ssh/authorized_keys - shell automatizĂĄlĂĄsa - mintha soronkĂŠnt kiadnĂĄnk a parancsokat + +```shell-session +[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]$ +``` + +# shebang + +- file futtatĂĄsakor a kernel meglesi mi van az elejĂŠn +- el tudunk indĂtani scripteket programkĂŠnt +- `#!<program>` + +```shell-session +[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]$ +``` + +# tĹązfal + +- a kernel belsejĂŠben -> gyors, de low-level +- iptables +- kĂŠnyelmesebb egy tĹązfal-kezelĹ + +## UFW + +- uncomplicated firewall +- egyszerĹą + +```shell-session +[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 +``` + +# SSH kulcsok +