From 6ec55970fe70ad6306c768fe4a07acef50cec555 Mon Sep 17 00:00:00 2001 From: Silvino Silva Date: Fri, 26 Feb 2021 01:55:13 +0000 Subject: linux re-index --- linux/bash.html | 10 +++---- linux/dash.html | 4 +-- linux/fail2ban.html | 54 +++++++++++++++++++++++++++++++++ linux/index.html | 80 ++++++++++++++++++++++++++++++++++++------------- linux/network.html | 59 +++++++++++++++++++++++++++++------- linux/package.html | 16 +++++----- linux/tty-terminal.html | 4 +-- 7 files changed, 180 insertions(+), 47 deletions(-) create mode 100644 linux/fail2ban.html (limited to 'linux') diff --git a/linux/bash.html b/linux/bash.html index 1a7edb2..7b98eb5 100644 --- a/linux/bash.html +++ b/linux/bash.html @@ -2,12 +2,12 @@ - 2.5.2. Bash + 2.3.2. Bash GNU/Linux Index -

2.5.2. Bash

+

2.3.2. Bash

Just to be sure, setup bash as default login;

@@ -32,7 +32,7 @@ alias, editor. -

2.5.2.1. Profile

+

2.3.2.1. Profile

Example of ~/.profile;

@@ -73,7 +73,7 @@ fi fi -

2.5.2.2. Bash RC

+

2.3.2.2. Bash RC

Example of ~/.bashrc;

@@ -136,7 +136,7 @@ fi fi -

2.5.2.3. Bash profile

+

2.3.2.3. Bash profile

Example of ~/.bash_profile;

diff --git a/linux/dash.html b/linux/dash.html index 8da34a3..47b9945 100644 --- a/linux/dash.html +++ b/linux/dash.html @@ -2,13 +2,13 @@ - 2.5.1. Dash + 2.3.1. Dash GNU/Linux Index -

2.5.1. Dash

+

2.3.1. Dash

By default dash installed as /bin/sh, if not relink;

diff --git a/linux/fail2ban.html b/linux/fail2ban.html new file mode 100644 index 0000000..71bbdf9 --- /dev/null +++ b/linux/fail2ban.html @@ -0,0 +1,54 @@ + + + + + Fail2ban + + + + Tools Index + +

Fail2ban

+ +
+       $ prt-get depinst fail2ban
+       
+ +

1. Configure

+ +

To start fail2ban at next boot edit /etc/rc.conf and add fail2ban. + Fail2ban will verify if /etc/fail2ban/jail.local exist, if exist will + use it. Copy distribution jail.conf to jail.locol;

+ +
+       $ sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
+       
+ +

Edit /etc/fail2ban/jail.local, example configuration;

+ +
+       [ssh-iptables]
+
+       enabled  = enable
+       filter   = sshd
+       action   = iptables[name=SSH, port=ssh, protocol=tcp]
+                  sendmail-whois[name=SSH, dest=admin@box, sender=fail2ban@box, sendername="fail2ban"]
+                  logpath  = /var/log/auth
+                  maxretry = 5
+       
+ +

Test a filter

+ +
+        # fail2ban-regex /var/log/iptables iptables-ssh.conf
+        
+ + Tools Index + +

+ This is part of the LeetIO System Documentation. + Copyright (C) 2021 + LeetIO Team. + See the file Gnu Free Documentation License for copying conditions.

+ + diff --git a/linux/index.html b/linux/index.html index 33578f7..482730a 100644 --- a/linux/index.html +++ b/linux/index.html @@ -105,31 +105,38 @@
  • 2.1.6. Remove
  • -
  • 2.2. Network + +
  • 2.2. Package Management
  • -
  • 2.3. Package Management + +
  • 2.3. Terminals and shells
  • -
  • 2.4. Terminals and shells - +
  • 2.4. Syslog-ng +
  • +
  • 2.5. Exim Documentation Index diff --git a/linux/network.html b/linux/network.html index ec33b25..a0e542e 100644 --- a/linux/network.html +++ b/linux/network.html @@ -2,12 +2,12 @@ - 2.2. Network + 2.7. Network GNU/Linux Index -

    2.2. Network

    +

    2.7. Network

    Operation of the network can be handle with init scripts or with network manager;

    @@ -52,7 +52,7 @@ described scripts then proceed to update system.

    -

    2.2.1. Resolver

    +

    2.7.1. Resolver

    This example will use Chaos Computer Club @@ -68,7 +68,7 @@ # chattr +i /etc/resolv.conf -

    2.2.2. Static IP

    +

    2.7.2. Static IP

    Current example of /etc/rc.d/net;

    @@ -115,7 +115,7 @@ # ip route add default via ${GW} -

    2.2.3. Iptables

    +

    2.7.3. Iptables

    For more information about firewall systems read arch wiki iptables @@ -269,7 +269,7 @@ # iptables -L -n -v | less -

    2.2.3.1. Iptable scripts

    +

    2.7.3.1. Iptable scripts

    Scripts help to setup iptables rules so they can be saved using iptables-save and later restored using iptables-restore utilities. Init script @@ -309,7 +309,45 @@

    From now on use /etc/rc.d/iptables to start and stop.

    -

    2.2.4. Wpa and dhcpd

    +

    2.7.4 Bridges

    + +

    For more information about bridges read + bridges with iptables. + Script /etc/rc.d/blan creates br0 bridge interface + with 10.0.0.1 ip. Number of tap interfaces created and attached depends on number + of cpu cores available. Ethernet interface is added to the bridge. Edit /etc/rc.conf + to setup interfaces at startup;

    + +
    +        #
    +        # /etc/rc.conf: system configuration
    +        #
    +
    +        FONT=default
    +        KEYMAP=dvorak
    +        TIMEZONE="Europe/Lisbon"
    +        HOSTNAME=machine
    +        SYSLOG=sysklogd
    +        SERVICES=(lo iptables wlan blan crond)
    +
    +        # End of file
    +        
    + +

    Change iptables init script + /etc/rc.d/iptables + and set TYPE to bridge, + /etc/iptables/bridge.v4. + Now change + ipt-conf.sh + and ipt-bridge.sh + with your network configuration and run; +

    + +
    +        # bash ipt-bridge.sh
    +        
    + +

    2.7.5. Wpa and dhcpd

    There is more information on Wiki Wifi Start Scripts and @@ -327,7 +365,7 @@ # iwconfig wlp2s0 essid NAME key s:ABCDE12345 -

    2.2.4.1. Wpa Supplicant

    +

    2.7.4.1. Wpa Supplicant

    Configure wpa supplicant edit;

    @@ -357,7 +395,7 @@ init script to auto load wpa configuration and dhcp client.

    -

    2.2.4.2. Wpa Cli

    +

    2.7.4.2. Wpa Cli

             # wpa_cli
    @@ -396,7 +434,7 @@
             > save_config
             
    -

    2.2.5. Network Manager

    +

    2.7.6. Network Manager

    Wifi status;

    @@ -425,6 +463,7 @@ nmcli> save persistent + GNU/Linux Index

    This is part of the LeetIO System Documentation. diff --git a/linux/package.html b/linux/package.html index 4b68b6a..78069eb 100644 --- a/linux/package.html +++ b/linux/package.html @@ -2,13 +2,13 @@ - 2.3. Package Management + 2.2. Package Management GNU/Linux Index -

    2.3. Package Management

    +

    2.2. Package Management

    For more information read crux handbook Package management front-end: @@ -57,7 +57,7 @@ $ prt-get depinst prt-utils prt-get-bashcompletion -

    2.3.1. Update System

    +

    2.2.1. Update System

    Before build software get latest version of port collections;

    @@ -87,7 +87,7 @@ $ prt-get update -fr $(revdep) -

    2.3.2. Install port and dependencies

    +

    2.2.2. Install port and dependencies

    Installing using prt-get tool;

    @@ -111,7 +111,7 @@

    If you user pkgmk and pkgadd allways check if README, pre and post instal files exist.

    -

    2.3.3. Ports collections

    +

    2.2.3. Ports collections

    Clone this documentation;

    @@ -146,7 +146,7 @@ $ sudo ports -u ports -

    2.3.4. Show port information

    +

    2.2.4. Show port information

             $ prt-get info port_name
    @@ -164,13 +164,13 @@
             $ pkginfo -o filename
             
    -

    2.3.5. Show port dependencies

    +

    2.2.5. Show port dependencies

             $ prt-get depends port_name
             
    -

    2.3.6. Print information

    +

    2.2.6. Print information

    Example how to get ports installed from contrib. Maybe there is a "cleaner" way to this, for now is ok;

    diff --git a/linux/tty-terminal.html b/linux/tty-terminal.html index 77c7b9d..60a9f5d 100644 --- a/linux/tty-terminal.html +++ b/linux/tty-terminal.html @@ -2,13 +2,13 @@ - 2.4. Consoles, terminals and shells + 2.3. Consoles, terminals and shells GNU/Linux Index -

    2.4. Consoles, terminals and shells

    +

    2.3. Consoles, terminals and shells

    Consoles
    -- cgit 1.4.1-2-gfad0