I've got a custom application which works fine when run directly from the command line in Ubuntu VM or over SSH if I type the commands myself in the prompt.

If I run the same application by connecting to the Ubuntu over SSH (from Windows machine) and sending the command as part of the ssh command, the SSH console doesn't print any output from the application. The application (effectively a TCP server) seems dead as I can't connect to it at that point. However when I close the command prompt and effectively end the SSH session the application springs to life and I can connect to it, no problems!

When I run who in Ubuntu VM it doesn't list the SSH connection at all, but if I run ss -t -a I can see that the application is actually listening. Doing ps doesn't show the application running either.

Does it make any sense to anyone?

  • 1
    Please edit your question and show the exact commands you run directly and using SSH and add details about the "custom application". Show the ps command you use. The application might run in the background in a separate process group, and you might need additional options for ps.
    – Bodo
    Commented May 10, 2023 at 11:28

1 Answer 1


It seem I forgot a few things when constructing the command. This one works as intended:

ssh -t [email protected] "sudo ./xyz.sh; exec bash -l"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .