Skip to content
Advertisement

Get the PID of a process started with sudo via ssh

I need the process id of a process (here sleep 20) started remotely via SSH and sudo.

date is inserted to illustrate the duration of the SSH connection. Without connection there is also no process on my remote machine, of course.

JavaScript

On a second machine the last, complete command works fine:

JavaScript

Any suggestion why there is this different behaviour of the two machines?

Info: I know the risk of clear passwords but it’s a shared account in an isolated test network.

Advertisement

Answer

It looks like an issue with incomplete process dependencies. With some additional milliseconds the connection (and process) keeps established the whole time.

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement