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 +