I changed my rsync backup script to use root (well, sudo) to sync my desktop machine with my fileserver after the recent problems I found with BackInTime not being able to read my entire $HOME directory.

That gave rise to the problem that if I ssh from the desktop into the fileserver, run screen, run ssh-add, run the rsync script and then detach the screen, the $SSH_AUTH_SOCK variable gets nuked, so after the first call to rsync-over-ssh, the script prompts for the ssh key’s passphrase again.

The fix for this, is to create a specific ssh-agent socket for screen and get it to call that when you run screen (and then ssh-add). So put this near the top of ~/.screenrc (also removes the stupid startup prompt):

setenv SSH_AUTH_SOCK $HOME/.screen-ssh-agent
screen ssh-agent -a $SSH_AUTH_SOCK $SHELL
startup_message off

I also noticed whilst testing this, that you have to wait for the socket to get removed before starting a new screen instance, otherwise screen just exits. This could be fixed by making a socket based on the PID of the screen instance, but it seems screen 4.00 at least doesn’t evaluate $PID from .screenrc

Update: screen 4.2 (aka 4.02) passes the $PID variable, so you can fix the multi socket issue with:

setenv SSH_AUTH_SOCK $HOME/.screen-ssh-agent.$PID
screen ssh-agent -a $SSH_AUTH_SOCK $SHELL
startup_message off

It seems that a recent commit to AOSP regarding screen orientation on Android smartphones with keyboards has broken the ZTE Blade build of Cyanogenmod7 N71 so that the screen is locked sideways – possibly related to the screen being mounted upside down as I found with the screenshot issue yesterday. Its a pain as the new sensor libs and libaudio.so patch were merged at the same time, so nightly 71 should have been a really solid build!