Trying to run a command on Lish remotely through SSH
ssh linode******@london***.linode.com "/usr/local/bin/mylinodescript arg1 arg2"
Where linode***@london.linode.com is the SSH command to enter Lish on the Linode. So basically I want to run mylinodescript on my Linode. I don't need to enter a password when I run the above command, because I use Lish via SSH Keys, so the SSH login happens automatically.
However, when I run it on my desktop I get the following error:
Unknown command '/usr/local/bin/mylinodescript arg1 arg2'
Even if I replace the command with "echo hi", I get:
Unknown command 'echo hi'
What am I doing wrong? Also, I need to log in via Lish and not via regular SSH into the Linode, because this script has to do with recovery situations where we cannot log in via regular SSH. Any help you could provide would be great, thanks.
4 Replies
It would be easier to place your public key directly on your Linode and execute the command that way. Unless you corrupt you Linode's ssh server, there shouldn't be a need to go through lish since it's intended as a backup for ssh.
if you have ssh server running on your node, just establish ssh session directly to the node and not to the console.
The very first link in google search :