I am finding hard to run a process at background using paramiko. I used :
stdin, stdout, stderr = ssh.exec_command(\'executefile.py &\')
exec_command
isn't executing the command in an interactive shell, so "running a process in the background" doesn't really make sense.
If you really want to do this, you could use the command nohup
to start your process, and keep it alive when the session exits. Remember that you can't get stdin, stdout, or stderr when you do this, since you are detaching the process from the shell, so redirect them accordingly.