Thursday, October 28, 2021

[SOLVED] Problem running asterisk command through ssh

Issue

i need execute remotly an asterisk command via SSH and get the output. The command to execute is this:

asterisk -rx "core show channels"

and i run remotely this:

sshpass -p PASSWORD ssh HOST asterisk -rx 'core show channels'

but i get

No such command 'core' (type 'core show help core' for other possible commands)

PD: When i run the first command locally I dont get the same, it's runs correctly. This problem does not happen if i exect a no asterisk command. Example "ls -l"

Any help ?


Solution

Try

sshpass -p PASSWORD ssh HOST "/usr/sbin/asterisk -rx 'core show channels'"



Answered By - arheops