Remotely starting a screen session through ssh and closing the ssh session immediately
You can use -d -m
to your screen session to do it like:
ssh myuser@hostname screen -d -m "python somepath.py -s 'potato'"
That will create a new screen session, run your command in it and automatically detach you from it.
That option is documented as
-d -m
Start screen in detached mode. This creates a new session but doesn't attach to it. This is useful for system startup scripts.
on the GNU documentation page for screen