Mac: VPN over SSH using sshuttle


Summary:
Sometimes it's simply easier to run or do things from your local system rather than rely on a bastion/jumphost.  sshuttle allows you to utilize a Linux bastion/jumphost as a psuedo VPN endpoint.

Full documentation and source can be found here:
http://sshuttle.readthedocs.io/en/stable/manpage.html
https://github.com/apenwarr/sshuttle

Walkthrough:
Brew is probably the easiest installation method and less prone to complications by using pip.  So that's what I'll go through here:

  1. Launch Terminal
  2. brew install sshuttle
  3. sshuttle -r usernameonLinuxSSHhost@LinuxSSHhostnameorIP 192.168.50.0/24
Done.  Easy right?  Now upon successful connection, all traffic bound for an ip on 192.168.50.0/24 will tunnel through your Linux SSH host.  

Additional Notes:
Remember to kill your session when done.  I've heard of reports that sshuttle having memory leaks or whatnot causing RAM to fill up.  Killing terminal session should kill it, but you may need to kill in activity monitor.

This type of tunneling can also be done on Windows via SOCKS5 proxying.  You can find details on how to do that here:
https://www.digitalocean.com/community/tutorials/how-to-route-web-traffic-securely-without-a-vpn-using-a-socks-tunnel

Handy Firefox add-on for selective proxying:
https://addons.mozilla.org/en-US/firefox/addon/foxyproxy-standard/


Powershell: PS Core on Mac updating on launch and setting an alias for brew cask based installs...


Summary:
You can now install powershell core via homebrew on a Mac.  One thing I noticed is that it doesn't, which the pkg installers do, set an alias to launch powershell in the terminal.  Instead it installs an "app" in your applications directory to launch powershell.  Two things I wanted to accomplish:

  1. Set an alias to launch powershell in terminal
  2. Update powershell on launch.
Solution:
Easiest way to go about this is simply to insert some alias into my .bash_profile.  Like so:
  1. Launch Terminal
  2. nano ~/.bash_profile
    • or vi if that suits your fancy.
  3. alias powershellupdate="brew update; brew cask reinstall powershell; pwsh"
  4. alias powershell="pwsh"
  5. Exit [Ctrl+X] and Y to save.
  6. source .bash_profile
    • This is to refresh your current bash session w/ your newly edited profile.
Once done, I can now type either "powershellupdate" or "powershell" in terminal.  I did this approach for simplicity so I can quickly launch powershell if I don't need it to be updated or don't happen to have internet connectivity at time of launch.  Further down the line, I think I'm going to try and figure out available version prior to doing a reinstall.