From 2b29e812468ae2f33a4d37e2e280b7080f11ee86 Mon Sep 17 00:00:00 2001 From: Dmitry Ilvokhin Date: Sat, 24 Feb 2024 18:36:32 +0000 Subject: Add simple dotfiles management playbook --- misc/dotfiles/ssh/rc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 misc/dotfiles/ssh/rc (limited to 'misc/dotfiles/ssh/rc') diff --git a/misc/dotfiles/ssh/rc b/misc/dotfiles/ssh/rc new file mode 100755 index 0000000..c129eb8 --- /dev/null +++ b/misc/dotfiles/ssh/rc @@ -0,0 +1,20 @@ +#! /usr/bin/env bash + +# Credits: https://gist.github.com/martijnvermaat/8070533 + +# Fix SSH auth socket location so agent forwarding works with screen. +if test "$SSH_AUTH_SOCK" ; then + ln -sf $SSH_AUTH_SOCK ~/.ssh/ssh_auth_sock +fi + +# Taken from the sshd(8) manpage. +if read proto cookie && [ -n "$DISPLAY" ]; then + if [ `echo $DISPLAY | cut -c1-10` = 'localhost:' ]; then + # X11UseLocalhost=yes + echo add unix:`echo $DISPLAY | + cut -c11-` $proto $cookie + else + # X11UseLocalhost=no + echo add $DISPLAY $proto $cookie + fi | xauth -q - +fi -- cgit v1.2.3-70-g09d2