Syncing your SSH/RDP sessions with Dropbox and MobaXterm

I do most of my work from home.

Being a network guy, I have a pretty good ability at memorizing IP addresses, however I’ve grown tired of this.  So now I use MobaXterm for managing my SSH/RDP/other sessions.

That is great and all, but I run into situations where I need to show a customer or colleague something from my lab environment when working on my laptop remotely.

I could always VPN home, then remote desktop to my PC, but I’ve had issues with from laggy wifi, etc.

So now I have a simple hack that I threw together so that all of my MobaXterm sessions will sync between my desktop and laptop.

So, you need the following two things to make this happen:

  1. MobaXterm must be installed on both machines
  2. Dropbox/OneDrive/Owncloud/sync service of your choice must be installed on both machines (I use Dropbox)

Once you have completed both of the following all you need to do is copy your MobaXterm.ini file to a sync folder and create a symlink!

On your first PC launch an administrative command prompt and do the following:

Now all you need to do on your second (and any subsequenct) PC/Laptop is launch an administrative command prompt and do the following:

Now, whenever you create new sessions the INI file will be updated and synced to all your other machines!

It is worth noting that in order to see new sessions that have been synced you’ll need to close and re-open MobaXterm on any remote PCs (so that the updated INI file is read).

Now when I am remote I can just fire up my VPN and use MobaXterm just like I would at home, and this is extra nice because with MobaXterm you can configure sessions for just about anything (SSH,Telent,RDP,Mosh,VNC,Serial,etc).

Using Powershell and Posh-SSH to GSD.

I’m a guy who thinks you should use the right tool for the job.

For instance, if you’re in a Windows environment, and you need to script something, installing Cygwin just so you can use BASH is probably not the right way to go.

That being said, I love BASH, but I find myself in Windows environments more and more, so I figured it was time to dust off my PowerShell skills- Especially when I found out about Posh-SSH.

Posh-SSH is one of the (for now) missing SSH libraries that Windows/PowerShell so desperately needs.

You can use Posh to create SSH sessions, send commands and teardown ssh sessions.

This script can log into several devices simultaneously, then run several different commands (of your choosing) on each of the devices, then either display the output on the console, or write to a log file for each device.

It is still a work in progress, and I will probably add a few things to it like:

  • Choosing the directory where the log files go
  • Doing various console cleanup based on the device you are logging into
  • Have all of the input via console (instead of pop-ups)

A few limitations:

  • The devices that this is run against must have the same user/pass
  • The devices that this run against need to support the same commands (or you won’t get any valid input
  • Commands that expect a break to stop (like ping in Linux), will keep running as we are unable to pass a break at this point in time

Find the script below, enjoy!