Skip to content

Instantly share code, notes, and snippets.

@elmarcoh
Created August 16, 2013 14:30
Show Gist options
  • Save elmarcoh/6250407 to your computer and use it in GitHub Desktop.
Save elmarcoh/6250407 to your computer and use it in GitHub Desktop.
Fix ssh with auth (cert) fowarding (ssh -A) to work with screen Run this script prior to attaching or launching screen, and it will generate a file named "fixssh" exporting a series of envvars. Once on screen you must source ~/fixssh to use your machine's cert intead of the remote's one.
#!/bin/sh
SSHVARS="SSH_CLIENT SSH_TTY SSH_AUTH_SOCK SSH_CONNECTION DISPLAY"
for x in ${SSHVARS} ; do
(eval echo $x=\$$x) | sed 's/=/="/
s/$/"/
s/^/export /'
done 1>$HOME/fixssh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment