Call killpg() with correct pid and only if process hasn't exited.
Add precheck to check for server ssh and sudo without password