diff --git a/SSH Notes.md b/SSH Notes.md deleted file mode 100644 index ed2b22d..0000000 --- a/SSH Notes.md +++ /dev/null @@ -1,211 +0,0 @@ -# SSH Notes - -## SSH Tunneling - -### Local Forwarding - -#### Examples - -NOTE: these use autossh to prevent the tunnel from dying - -Plex - -```shell -autossh -f -nNT -p3141 -N -L 8080:192.168.0.209:32400 chawley@aristotle.planethawleywood.com -``` - -ESXi - -```shell -autossh -f -nNT -p3141 -N -L 8090:192.168.0.208:443 chawley@aristotle.planethawleywood.com -``` - -Both ESXi and AWX - -```shell -autossh -f -nNT -p3141 -N -L 8090:192.168.0.208:443 -L 8091:192.168.0.25:80 chawley@aristotle.planethawleywood.com -``` - -Both Plex and Derry OD - -```shell -autossh -f -nNT -p3141 -N -L 8080:192.168.0.209:32400 -L 8070:192.168.0.209:80 chawley@aristotle.planethawleywood.com -``` - ---- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Protocol - SSH -
From - my office workstation -
To - RRD Jumpbox (54.84.9.50) -
Via - chawley2@ladmin2 -
Notes - I have the jumpbox host configured in.ssh/config on both machines -
ssh -N -L 8090:54.184.92.50:22 chawley2@ladmin2.precisiondm.com -
- - - - - - - - - - - - - - - - - - - - - - - -
Protocol - web -
From - my office workstation -
To - Plex (derry) -
Via - chawley@aristotle -
ssh -p3141 -N -L 8080:192.168.0.209:32400 chawley@aristotle.planethawleywood.com -
- - -### Remote Forwarding - -NOTE: By default, OpenSSH only allows connecting to remote forwarded ports from the server host. However, the GatewayPorts option in the server configuration file sshd_config can be used to control this. - -The following alternatives are possible: - -```shell -GatewayPorts no -``` - -This prevents connecting to forwarded ports from outside the server computer. - -```shell -GatewayPorts yes -``` - -This allows anyone to connect to the forwarded ports. If the server is on the public Internet, anyone on the Internet can connect to the port. - -#### Examples - - - - - - - - - - - - - - - - - - - - - -
Protocol - web -
From - derry -
To - overlook -
Notes - This allows you to access apache web pages on derry by visiting http://overlook.planethawleywood.com:8888 as long as GatewayPorts yes is present in /etc/ssh/sshd_config (as explained above) and port 8888 is open on Overlook -
ssh -R 8888:localhost:80 root@overlook -
- -### Reference - -* [How To Use SSH Tunneling](https://www.howtogeek.com/168145/how-to-use-ssh-tunneling/) -* [SSH Port Forwarding Example](https://www.ssh.com/ssh/tunneling/example) - - -## Kill Unresponsive SSH - -### Summary - -Let’s say you’re happily typing in your remote shell when all of a sudden, the crappy Wi-Fi network you’re using goes down. You end up with a perfectly unusable frozen shell, ugh! - -To do that, assuming you lost connectivity, press in that order: - - -```shell -[Enter] -~ -. -``` - - -That is, <return key> then tilde then period - -This will send an escape sequence to your local SSH client and terminate the connection.—So this will always work even without a network connection. - -Here’s the list of escape sequences: - - -### Supported escape sequences: - -`~.` - terminate connection (and any multiplexed sessions) \ -`~B` - send a BREAK to the remote system \ -`~C` - open a command line \ -`~R` - Request rekey (SSH protocol 2 only) \ -`~^Z `- suspend ssh \ -~# - list forwarded connections \ -~& - background ssh (when waiting for connections to terminate) \ -~? - this message \ -~~ - send the escape character by typing it twice \ - \ -(Note that escapes are only recognized immediately after newline.) - - -## SSH Keygen - -### Generate an SSH Key with a comment - -```shell -ssh-keygen -C "comment" -f -``` - diff --git a/10 Minute Guide to diff and patch.md b/blog - 10 Minute Guide to diff and patch.md similarity index 100% rename from 10 Minute Guide to diff and patch.md rename to blog - 10 Minute Guide to diff and patch.md diff --git a/BASH Challenges.md b/blog - BASH challenges.md similarity index 100% rename from BASH Challenges.md rename to blog - BASH challenges.md diff --git a/CPU Steal.md b/blog - CPU steal.md similarity index 100% rename from CPU Steal.md rename to blog - CPU steal.md diff --git a/KiTTy vs PuTTy.md b/blog - KiTTy vs PuTTy.md similarity index 100% rename from KiTTy vs PuTTy.md rename to blog - KiTTy vs PuTTy.md diff --git a/LXC Cheatsheet.md b/blog - LXC Cheatsheet.md similarity index 100% rename from LXC Cheatsheet.md rename to blog - LXC Cheatsheet.md diff --git a/Markdown notes with VS Code.md b/blog - Markdown notes with VS Code.md similarity index 100% rename from Markdown notes with VS Code.md rename to blog - Markdown notes with VS Code.md diff --git a/OpenVPN.md b/blog - OpenVPN.md similarity index 100% rename from OpenVPN.md rename to blog - OpenVPN.md diff --git a/blog - SSH tunneling.md b/blog - SSH tunneling.md new file mode 100644 index 0000000..63d0212 --- /dev/null +++ b/blog - SSH tunneling.md @@ -0,0 +1,82 @@ +# SSH Tunneling + +## Local Forwarding + +### Examples + +NOTE: these use autossh to prevent the tunnel from dying + +Plex + +```shell +autossh -f -nNT -p3141 -N -L 8080:192.168.0.209:32400 chawley@aristotle.planethawleywood.com +``` + +ESXi + +```shell +autossh -f -nNT -p3141 -N -L 8090:192.168.0.208:443 chawley@aristotle.planethawleywood.com +``` + +Both ESXi and AWX + +```shell +autossh -f -nNT -p3141 -N -L 8090:192.168.0.208:443 -L 8091:192.168.0.25:80 chawley@aristotle.planethawleywood.com +``` + +Both Plex and Derry OD + +```shell +autossh -f -nNT -p3141 -N -L 8080:192.168.0.209:32400 -L 8070:192.168.0.209:80 chawley@aristotle.planethawleywood.com +``` + +--- + +| Protocol | From | To | via | Notes | +| -------- | --------------------- | ----------- | ---------------- | ----------------------------------------------------------------- | +| SSH | my office workstation | RRD Jumpbox | chawley2@ladmin2 | I have the jumpbox host configured in.ssh/config on both machines | + +```shell +ssh -N -L 8090:54.184.92.50:22 chawley2@ladmin2 +``` + +| Protocol | From | To | via | Notes | +| -------- | --------------------- | ----------- | ---------------- | ----------------------------------------------------------------- | +| SSH | my office workstation | Plex (derry) | chawley@aristotle | | + +```shell +ssh -p3141 -N -L 8080:192.168.0.209:32400 chawley@aristotle.planethawleywood.com +``` + +## Remote Forwarding + +NOTE: By default, OpenSSH only allows connecting to remote forwarded ports from the server host. However, the GatewayPorts option in the server configuration file sshd_config can be used to control this. + +The following alternatives are possible: + +```shell +GatewayPorts no +``` + +This prevents connecting to forwarded ports from outside the server computer. + +```shell +GatewayPorts yes +``` + +This allows anyone to connect to the forwarded ports. If the server is on the public Internet, anyone on the Internet can connect to the port. + +### Example + +| Protocol | From | To | Notes | +| -------- | --------------------- | ----------- | -------------- | +| web | derry | overlook | This allows you to access apache web pages on derry by visiting http://overlook.planethawleywood.com:8888 as long as GatewayPorts yes is present in /etc/ssh/sshd_config (as explained above) and port 8888 is open on Overlook | + +```shell +ssh -R 8888:localhost:80 root@overlook +``` + +## Reference + +* [How To Use SSH Tunneling](https://www.howtogeek.com/168145/how-to-use-ssh-tunneling/) +* [SSH Port Forwarding Example](https://www.ssh.com/ssh/tunneling/example) \ No newline at end of file diff --git a/Fun with ISOs.md b/blog - fun with ISOs.md similarity index 100% rename from Fun with ISOs.md rename to blog - fun with ISOs.md diff --git a/Fun with Find.md b/blog - fun with find.md similarity index 100% rename from Fun with Find.md rename to blog - fun with find.md diff --git a/Fun with netplan.md b/blog - fun with netplan.md similarity index 100% rename from Fun with netplan.md rename to blog - fun with netplan.md diff --git a/Fun with wget.md b/blog - fun with wget.md similarity index 100% rename from Fun with wget.md rename to blog - fun with wget.md diff --git a/youtube-dl Tricks.md b/blog - fun with youtube-dl.md similarity index 100% rename from youtube-dl Tricks.md rename to blog - fun with youtube-dl.md diff --git a/Generic directory backup script.md b/blog - generic directory backup script.md similarity index 100% rename from Generic directory backup script.md rename to blog - generic directory backup script.md diff --git a/git tricks.md b/blog - git tricks.md similarity index 100% rename from git tricks.md rename to blog - git tricks.md diff --git a/Ubuntu phased updates.md b/blog - ubuntu phased updates.md similarity index 100% rename from Ubuntu phased updates.md rename to blog - ubuntu phased updates.md diff --git a/Port information on Linux.md b/blog - why is that port open.md similarity index 100% rename from Port information on Linux.md rename to blog - why is that port open.md diff --git a/Calibre Content Server style sheet.md b/config - Calibre Content Server css.md similarity index 100% rename from Calibre Content Server style sheet.md rename to config - Calibre Content Server css.md diff --git a/Imagus Seive Grants.md b/config - Imagus Seive Grants.md similarity index 100% rename from Imagus Seive Grants.md rename to config - Imagus Seive Grants.md diff --git a/beets config.md b/config - beets.md similarity index 100% rename from beets config.md rename to config - beets.md diff --git a/Redshift Config.md b/config - redshift.md similarity index 100% rename from Redshift Config.md rename to config - redshift.md diff --git a/Ansible vault encrypt-decrypt.md b/howto - Ansible vault encrypt-decrypt.md similarity index 100% rename from Ansible vault encrypt-decrypt.md rename to howto - Ansible vault encrypt-decrypt.md diff --git a/Linode S3 Object Storage.md b/howto - Linode S3 Object Storage.md similarity index 100% rename from Linode S3 Object Storage.md rename to howto - Linode S3 Object Storage.md diff --git a/howto - SSH keygen.md b/howto - SSH keygen.md new file mode 100644 index 0000000..1e8d415 --- /dev/null +++ b/howto - SSH keygen.md @@ -0,0 +1,7 @@ +# SSH Keygen + +## Generate an SSH Key with a comment + +```shell +ssh-keygen -C "comment" -f +``` \ No newline at end of file diff --git a/View Apache requests per hour.md b/howto - apache requests per hour.md similarity index 100% rename from View Apache requests per hour.md rename to howto - apache requests per hour.md diff --git a/Clean up old snaps.md b/howto - clean up old snaps.md similarity index 100% rename from Clean up old snaps.md rename to howto - clean up old snaps.md diff --git a/How to kill an unresponsive SSH session.md b/howto - kill unresponsive SSH.md similarity index 100% rename from How to kill an unresponsive SSH session.md rename to howto - kill unresponsive SSH.md diff --git a/Almost line-speed file-copy using netcat.md b/howto - netcat file copy.md similarity index 100% rename from Almost line-speed file-copy using netcat.md rename to howto - netcat file copy.md diff --git a/Pandoc Conversions.md b/howto - pandoc conversions.md similarity index 100% rename from Pandoc Conversions.md rename to howto - pandoc conversions.md diff --git a/Send Mail from the Linux Command Line.md b/howto - send mail from cli.md similarity index 100% rename from Send Mail from the Linux Command Line.md rename to howto - send mail from cli.md diff --git a/tar without paths.md b/howto - tar without paths.md similarity index 100% rename from tar without paths.md rename to howto - tar without paths.md diff --git a/Zandronum.md b/howto - zandronum install.md similarity index 100% rename from Zandronum.md rename to howto - zandronum install.md