Jump to content

Workflow to set command in terminal on remote computer


Recommended Posts

Posted

Hi

 

I'm running a Raspberrry Pi with Pi-Hole. And I want a workflow to disable the pi-hole from my mac.

 

I use the "Run Script" with following commands:

 

ssh pi@192.168.178.3
pihole disable

Language is set to /bin/bash/

 

But I didn't get an error nor did the pi-hole disable. Sure I can enter the same command local from my mac - it's working.

 

What am I doing wrong?

 

 

regads from germany

grkngls

  • deanishe changed the title to Workflow to set command in terminal on remote computer
Posted
15 hours ago, grkngls said:

I use the "Run Script" with following commands

 

It won't work that way because we're talking about a script here, not an interactive shell session. When you run your first command (ssh pi@...) in an interactive shell, it opens an SSH session on the remote machine, and you are actually entering your second command in the SSH session.


You can tell SSH to run commands on remote machines, though, and yours would be something like: ssh pi@192.168.178.3 pihole disable

 

Posted

I do this, but use sshpass like this:

 

sshpass -p yourpasswordhere ssh pi@pihole 'pihole disable'

 

sshpass is not installed on Macs by default. I installed using home-brew. Be sure you understand any security issues this may cause on your Mac. 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...