From f12e934a9aab8ce5ddce34f232fe7e582640da53 Mon Sep 17 00:00:00 2001 From: mayfrost Date: Sun, 27 Jan 2019 00:39:39 -0300 Subject: [PATCH] Update NETWORKING.md --- NETWORKING.md | 51 ++++++++++++++++++++++++++++++++++----------------- 1 file changed, 34 insertions(+), 17 deletions(-) diff --git a/NETWORKING.md b/NETWORKING.md index e5593cd..b312864 100644 --- a/NETWORKING.md +++ b/NETWORKING.md @@ -1,5 +1,20 @@ # NETWORKING +## TOC +1. [SETUP](#setup) +1.1 [/etc/network/interfaces](#/etc/network/interfaces) +1.2. [WiFi](#wifi) +2. [FIREWALL](#firewall) +2.1. [ufw](#ufw) +3. [SSH](#ssh) +3.1. [CLIENT](#client) +3.2. [SERVER](#server) +4. [TROUBLESHOOTING](troubleshooting) +4.1. [tcpdump](#tcpdump) +4.2. [netstat](#netstat) +4.3. [traceroute](#traceroute) +4.4. [nmap](#nmap) + ## SETUP ### /etc/network/interfaces @@ -39,7 +54,7 @@ You can save either example in a script to activate the Wi-Fi whenever you want. * Note: As an educational tip, the name of a network is also called "_SSID_" in other places. -## TROUBLESHOOTING +## FIREWALL ### ufw * Show status @@ -61,6 +76,24 @@ You can save either example in a script to activate the Wi-Fi whenever you want. * Allow a specific port for a specific address `sudo ufw allow from IP_ADDRESS to any port PORT_NUMBER` +## SSH +### CLIENT +* login to remote host +`ssh ADDRESS` +* login to remote host as user USER +`ssh USER@ADDRESS` + +## SERVER +* set ssh server configuration in /etc/ssh/sshd_config +``` +Port 22 # default port is 22, can be changed +PermitRootLogin without-password # change "without-password" to "no" to forbid root login +AllowUsers USER_NAME # by allowing a specific user it restricts the others +``` +* restart "ssh" service to activate changes + +## TROUBLESHOOTING + ### tcpdump * dump all `sudo tcpdump` @@ -116,19 +149,3 @@ You can save either example in a script to activate the Wi-Fi whenever you want. `nmap --reason IP_NUMBER` * show host interfaces `nmap --iflist IP_NUMBER` - -## REMOTE CONNECTION -### SSH -* login to remote host -`ssh ADDRESS` -* login to remote host as user USER -`ssh USER@ADDRESS` - -## SERVER -* set ssh server configuration in /etc/ssh/sshd_config -``` -Port 22 # default port is 22, can be changed -PermitRootLogin without-password # change "without-password" to "no" to forbid root login -AllowUsers USER_NAME # by allowing a specific user it restricts the others -``` -* restart "ssh" service to activate changes