Plink.exe terminal window - escape characters showing

I created a batch file to login using plink

I’m using the following switches

-l user -pw password -batch -ssh

When I login to vera using putty everything looks fine, however with the above switches through plink in the terminal window its showing escape characters as shown in the image? Any ideas what other switch/param i’m missing. Thx for ur help

When you login to Vera, it’s expecting a certain type of terminal emulation to be setup. This is how all the color coded directory names etc come up. Looks like plink.exe isn’t setup to handle these terminal escape sequences

@guessed - putty just works fine, I’ll stick to that then. Actually I was wanting to use plink so I can also port forward with a single command …

This is something you might already know…
I ran a find / -name *.xml’ and I only see very few xml files - I was wanting to find out where the Device.xml files are located and have no clue why it didnt return those…help please?

They’re compressed, so they have .xml.lzo extensions. User defined ones are in /etc/cmh-ludl, system ones are in /etc/cmh-lu but they all binary-compressed using pluto-lzo after file upload to Vera…

Btw, putty has some tunneling capabilities also

Thank you so much guessed :slight_smile:

I was using plink for the following purpose, since it would allow me to login non-interactively…

  1. Have a web server with a login page ( I still need to add a self signed ssl certificate to it)
  2. after login, it uses plink to port forward to an arbitary port from vera through ssh tunnel
  3. the tunnel itself is only available for about 2 minutes or so, then it closes.

I did this, Just in case cp.mios was not available and need to get to vera remotely.

[quote=“mysticjay, post:5, topic:169225”]Thank you so much guessed :slight_smile:

I was using plink for the following purpose, since it would allow me to login non-interactively…

  1. Have a web server with a login page ( I still need to add a self signed ssl certificate to it)
  2. after login, it uses plink to port forward to an arbitary port from vera through ssh tunnel
  3. the tunnel itself is only available for about 2 minutes or so, then it closes.

I did this, Just in case cp.mios was not available and need to get to vera remotely.[/quote]

My I ask how you have this configuration setup? I am curious.

  • Garrett

Garrett,
Here are the overall details:

Requirements:

  1. Need a webserver on your home network.
  2. Open up an arbitrary port on your firewall. There is no harm as nothing is listening to it. For the explanation I’ll use port 1234

Connecting to Vera:

  1. Create a login page so you’re able to authenticate to your webserver
  2. Once authenticated, establish a SSH tunnel which forwards vera’s port 80 to 1234. The following plink command will do it. You need to kick start a process to start plink to do the following after authentication.
    a. plink.exe -L 0.0.0.0:1234:veraip:80 -l username -batch -pw password
    b. veraip = ip address of vera on your local network
  3. So now you’re able to get to vera remotely outside the firewall on port 1234 (which is vera’s port 80)
  4. After X amount of time (that you think you would need to do anything with Vera), kill the plink process and the port forwarding would stop and again NOTHING is listening on port 1234.

My eventual goal is not to use 0.0.0.0 and only allow the webserver itself to communicate to Vera. But again I have few other checks in authentication including the type of user agents and other things.

Are you creating the port on the firewall to direct to the webserver? You are than establishing an SSH connection from the webserver to itself and then pointing your web browser from the other machine to the port which directs to Vera?

  • Garrett

Are you creating the port on the firewall to direct to the webserver?

The port 1234 (example port) is configured in firewall to point to the same IP as your webserver’s IP. However nothing would be actually listening on it, until you login through your web server.

You are than establishing an SSH connection from the webserver to itself and then pointing your web browser from the other machine to the port which directs to Vera?

There is only one difference:

You are than establishing an SSH connection from the webserver to VERA and then pointing your web browser from ANY other machine to the port on the webserver which directs to Vera.

I just tried it out and it works. But my webserver is running off of linux and it is easier to accomplish with the ssh command.

With linux, instead of having to ssh into vera, you can have the ssh session connect to itself (webserver) as long as a ssh server is setup. e.g ssh -L webserverip:1234:veraip:80 user@webserverip

You can than use a public key and not require to use a password. Not sure how this would be done on the windows side. There are a few ssh servers available for the windows side to make this possible. Another option is to buy a pogoplug (can find them for around 40 dollars pink model) and setup a webserver and ssh server to accomplish similar task. Or just an ssh server to ssh and do port forwarding.

A php script can be written to issue the ssh command and kill the session. And the script can be accessed via https authentication. You could even have the php script to display a connect and disconnect button for the ssh session.

Now if you really want to get technical, you can also write a small program to open up the port on the router via upnp.

  • Garrett

Awsome 8)