Simple SSH script doesn't work

All kinds of 'OS' scripts

Moderator: leecollings

Post Reply
BlueLizard
Posts: 2
Joined: Friday 14 February 2020 18:13
Target OS: -
Domoticz version:
Contact:

Simple SSH script doesn't work

Post by BlueLizard »

I'm trying to write a simple script that SSHs into a server and kills a task. Like most things in domoticz this doesn't work. All the other commands in the script work apart from:

"C:\Program Files\PuTTY\putty.exe" -ssh "username 1"@192.168.0.2 -pw p@ssw0rd -m "C:\Program Files (x86)\Domoticz\scripts\kill.txt"

Any advice at all? I'm so close to just scrapping domoticz and starting again with another system. :oops:
freijn
Posts: 536
Joined: Friday 23 December 2016 16:40
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands Purmerend
Contact:

Re: Simple SSH script doesn't work

Post by freijn »

Not the answer you are looking for I am afraid, but better scrap the Windhoos and move to linux.....
User avatar
FireWizard
Posts: 1905
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: Simple SSH script doesn't work

Post by FireWizard »

Hi,

Welcome on this forum. :(

However, to start a request for support with
Like most things in domoticz this doesn't work.
will not give you the desired result.

What you try to achieve has nothing to do with Domoticz, except that you want to execute a program, that is located in the directory Domoticz.
If you copy your script to the Windows directory, do you then conclude that nothing in Windows works?

Did you exchange the keys between your 2 machines?

Domoticz is a open-source application, developed by volunteers, available for free, supported by a lot of contributors.
With positive support we bring Domoticz further, but people, who prefer to move to 'another system" are encouraged to do so.

Regards
User avatar
erem
Posts: 230
Joined: Tuesday 27 March 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Amsterdam/netherlands
Contact:

Re: Simple SSH script doesn't work

Post by erem »

Agree with Firewizard, bashing domoticz in a help request accomplishes nothing.

having said that, here is my €.02

- does ssh work between the machines from the command line. if not, the problem is ssh config, not domoticz.
- you cannot execute txt files on windows. better rename kill.txt to kill.bat or kill.cmd
- spaces in a username is usually not a good idea, but it may be just the example.

like this

"C:\Program Files\PuTTY\putty.exe" -ssh "username1"@192.168.0.2 -pw p@ssw0rd -m "C:\Program Files (x86)\Domoticz\scripts\kill.bat"
Regards,

Rob
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest