set user id, preserving shell and environment, checking ssh agent