I'm trying to start a long-running process on a remote server, over SSH:
$ echo Hello | ssh user@host "cat > /tmp/foo.txt; sleep 100 &"
Here, sleep 100
is a simulation of my long-running process. I want this command to exit instantly, but it waits for 100 seconds. Important to mention that I need the job to receive an input from me (Hello
in the example above).
Server:
$ sshd -?
OpenSSH_8.2p1 Ubuntu-4ubuntu0.5, OpenSSL 1.1.1f 31 Mar 2020