Originally Posted by szboardstretcher
One possible solution is to add your user to the sudoers file. Then:
screen -S thesession
sudo "screen -S thesession -X stuff "ls"`echo -ne '\015'`"
I had thought of doing something like that, but as this needs to run from a script on a sever, which is unattended, I am not sure how to authenticate to sudo. Do you know of way? This would be an ideal solution if there is.