| | 3 | == SSH == |
| | 4 | |
| | 5 | {{{ |
| | 6 | nano /etc/ssh/sshd_config |
| | 7 | }}} |
| | 8 | |
| | 9 | Zmiana portu i zablokowanie logowania jako użytkownik root |
| | 10 | |
| | 11 | {{{ |
| | 12 | # What ports, IPs and protocols we listen for |
| | 13 | Port 2134 |
| | 14 | |
| | 15 | # Authentication: |
| | 16 | PermitRootLogin no |
| | 17 | }}} |
| | 18 | |
| | 19 | {{{ |
| | 20 | service ssh restart |
| | 21 | }}} |
| | 22 | |
| | 23 | == Opcje montowania == |
| | 24 | |
| | 25 | {{{ |
| | 26 | nano /etc/fstab |
| | 27 | }}} |
| | 28 | |
| | 29 | Dodanie opcji nodev,nosuid,noexec do punktu montowania dla /tmp |
| | 30 | |
| | 31 | {{{ |
| | 32 | /dev/mapper/vg0-tmp /tmp ext4 defaults,nodev,nosuid,noexec 1 2 |
| | 33 | }}} |
| | 34 | |
| | 35 | {{{ |
| | 36 | mount -o remount /tmp |
| | 37 | }}} |
| | 38 | |
| | 39 | == MOTD == |
| | 40 | |
| | 41 | {{{ |
| | 42 | nano /etc/motd.tail |
| | 43 | }}} |
| | 44 | |
| | 45 | {{{ |
| | 46 | ############################################################################### |
| | 47 | ## ## |
| | 48 | ### Authorized Access Only! ### |
| | 49 | ## ## |
| | 50 | ############################################################################### |
| | 51 | }}} |
| | 52 | |
| | 53 | == Firewall == |
| | 54 | |
| | 55 | {{{ |
| | 56 | iptables -A INPUT -i lo -j ACCEPT |
| | 57 | iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT |
| | 58 | iptables -A INPUT -m state --state NEW -p tcp --dport 2134 -s 213.227.67.33 -m comment --comment "BetaSoft" -j ACCEPT |
| | 59 | iptables -A INPUT -m state --state NEW -p tcp --dport 443 -j ACCEPT |
| | 60 | iptables -A INPUT -p icmp --icmp-type 8 -j ACCEPT |
| | 61 | |
| | 62 | iptables -P INPUT DROP |
| | 63 | iptables -P FORWARD DROP |
| | 64 | }}} |
| | 65 | |
| | 66 | Zapisanie aktualnych reguł firewall'a do pliku |
| | 67 | |
| | 68 | {{{ |
| | 69 | iptables-save > /etc/iptables.rules |
| | 70 | }}} |
| | 71 | |
| | 72 | Wczytywanie reguł firewall'a z pliku |
| | 73 | |
| | 74 | {{{ |
| | 75 | nano /etc/network/interfaces |
| | 76 | }}} |
| | 77 | |
| | 78 | {{{ |
| | 79 | auto eth0 |
| | 80 | iface eth0 inet static |
| | 81 | |
| | 82 | pre-up iptables-restore < /etc/iptables.rules |
| | 83 | }}} |
| | 84 | |