sshAutoConnect vCenter plugin

sshAutoConnect_feat

Here is our first vCenter plugin ! It’s been a while we wanted to do this, here it is now :p

sshAutoConnect is a vCenter (or more likely vSphere Client) plugin.

In vSphere Client, you can open plugin window in order to view installed/activated/available plugins through “Plug-ins > Manage Plug-ins…” :

sshAutoConnect plugin will allow you to automatically connect with SSH to ESX/i directly in vSphere Client.

It makes able to manage your SSH connection straight in vSphere Client.

So we decide to develop our own plugin to add this feature.

Installation

As every vSphere client plugin, you just need to download the archive below and uncompress it in the default vSphere client plugin folder, and restart the client :

C:\Program Files (x86)\VMware\Infrastructure\Virtual Infrastructure Client\Plugins

Configuration

The plugin setup is made as easy as possible. The plugin is built to use sshAutoConnect.xml file in the same folder that the .dll library that can be used to specify credentials for automatic connection (optional) :

<?xml version="1.0" encoding="utf-8" ?>
<credentials>
  <default>
    <login>root</login>
    <password>d3d3LnZtZHVkZS5mcg==</password>
  </default>
  <custom_servers>
    <server name="server-esx-01.vmdude.fr">
      <login>root</login>
      <password>d3d3Lmh5cGVydmlzb3IuZnI=</password>
    </server>
    <server name="server-esx-02.vmdude.fr">
      <login>root</login>
      <password>d3d3LnZtd2FyZS5mcg==</password>
    </server>
  </custom_servers>
</credentials>

The xml file have 2 branch : <default> and <custom_servers>

The branch <default> will be used if the server you’re trying to connect doesn’t exist in <custom_servers> branch. This allows you to make some exceptions for specific servers.

If the file doesn’t exist, the plugin will not provide any credential during SSH connection, therefore you’ll have to authenticate.

Note : The passwords put in configuration file have to be encoded in Base64, you can read our previous post about encode/decode Base64 with Powershell : Base64 managing

Usage

The usage of the plugin is very easy, you just have to right clic on the ESX/i server you wanted to connect and clic on sshAutoConnect :

Download

  • Here is the .zip archive with the plugin folder containing .dll file and a sample configuration file : sshAutoConnect
  • Here are the Visual Studio 2010 source (can be built as usual with MSBuild/csc/VisualStudio) : sshAutoConnect-sources

Note : a big thanks to R0llB4ck for his help and the trick with Embedded Resource in C#

Post also available in : French

20 comments

  1. You should probably put all your visual studio C# sources on github :-)

    It could give some traction to some plugins/new stuff :-)

    Like ssh for (VMs) by checking linux guest os types, based on vmware-tools nics IPs etc :-) (RDP could be done too I suppose)

    Great work !

  2. It’s a great idea !

    Yesterday, I had a little chat with @maishsk about making sshAutoConnect a “AutoConnect”-wide plugin, available for other type of objects like hosts, virtual machines and even nfs datastore (and using specific connection protocol, ssh or rdp)

    Thanks for the feedback though !

    • This is awesome!! Please man, do it for the VMs too :)

      Noticed you are using puttytray intead of vanilla putty. why?

      How can I provide username/password for puttytray? how are you feeding them to puttytray? (Sorry, I know it’s in the code, but I’m not a developer!)

      Regards

      • Thanks !
        I used puTTYTray instead of vanilla puTTY because I find systray support handy :p
        In order to configure passwords used, you must use the sshAutoConnect.xml file provided with the tools.
        You have to add your own password (encoded in base64) as described in this post.
        I’ve link a post about Base64 handling in order to convert a regular string (aka your password) in a base64 string in order to set up the configuration file.

          • You’re welcome.

            For the VM part of the tool, I’ve already thought about doing it, but know regular client is the Web one, the tools will be already obsolete.
            I should look into making a WebClient-compliant one (but I’m a lazy dude ^^)

    • I’ve started to think about it, but as there is no longer C# architecture available for WebClient, I should have rewrite it from scratch.
      It’s on my ToDoList :p

  3. Is there some kind of security, permission or once you add the plugins, everyone have access to it ?

    Thanx

  4. Thanx, I know that the pluggin is client side only. In my case, everyone use the same client (Admin, simple user, etc.). So if I’m right, if the pluggin is installed, everyone has access to it ?

  5. Why did it take me soooo long to look for this plug-in?!?!?!? I love it!

    I officially 2nd the request for the RDP plugin.

    Thanks!

    • Thank you Scott !

      Unfortunately, as this plugin will be discontinued on VMware WebClient (completely different client plugin architecture), I don’t think RDP plugin will come to life :(

Leave a Reply

Required fields are marked *.

*