SSH remote command execute stays without disconnect when finished execute?
9,391
Try redirecting stdin, stdout, and stderr to /dev/null. For an explanation, see https://serverfault.com/questions/36419/using-ssh-to-remotely-start-a-process.
Related videos on Youtube
Author by
user1289947
Updated on September 18, 2022Comments
-
user1289947 over 1 year
I am trying to build a script/command that will restart our Asterisk/Elastix service on our PBX. The script is basically using simple command with auto log-in public key that run from Ubuntu 14.04LTS:
The command script is:
ssh user@iphost 'service asterisk restart'
But after the command finished and service restarted, the ssh stays and only after ctrlc its breaks out.
My question, is how can I terminate the session after the command completes?
-
user1289947 almost 10 yearsHi i had "TERM environment variable not set" thanks any idea
-
user1289947 almost 10 yearsdidn't worked :-(
-
Louis Matthijssen almost 10 yearsAre you sure? The first one should always work. Can you post the output of the command?