Problem:
Connection to a remote host by ssh and starting screen in one command can cause following error:
ssh user@example.com screen -R -d
Must be connected to a terminal.
Solution:
Provide screen with a terminal by switch -t:
ssh -t user@example.com screen -R -d
Source: wlug.org.nz