wok-next rev 19409

openssh: add jump host ProxyCommand
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Sep 20 16:04:52 2016 +0200 (2016-09-20)
parents 1e6252d97317
children 3cf96e8a94d7
files openssh-pam/receipt openssh/receipt
line diff
     1.1 --- a/openssh-pam/receipt	Tue Sep 20 10:46:56 2016 +0200
     1.2 +++ b/openssh-pam/receipt	Tue Sep 20 16:04:52 2016 +0200
     1.3 @@ -49,8 +49,17 @@
     1.4  	sed -i 's|/usr/libexec/sftp-server|/usr/sbin/sftp-server|' \
     1.5  		$fs/etc/ssh/sshd_config
     1.6  
     1.7 -	# client bug CVE-2016-0777 and CVE-2016-0778
     1.8 -	echo -e '\nHost *\n  UseRoaming no' >> $fs/etc/ssh/ssh_config
     1.9 +	cat >> $fs/etc/ssh/ssh_config <<EOT
    1.10 +
    1.11 +# client bug CVE-2016-0777 and CVE-2016-0778
    1.12 +Host *
    1.13 +  UseRoaming no
    1.14 +
    1.15 +# From https://wiki.gentoo.org/wiki/SSH_jump_host  
    1.16 +Host *+*
    1.17 +  ProxyCommand ssh $(echo %h | sed 's/+[^+]*$//;s/\([^+%%]*\)%%\([^+]*\)$/\2 -l \1/;s/:/ -p /') exec nc -w1 $(echo %h | sed 's/^.*+//;/:/!s/$/ %p/;s/:/ /')
    1.18 +
    1.19 +EOT
    1.20  }
    1.21  
    1.22  post_install()
     2.1 --- a/openssh/receipt	Tue Sep 20 10:46:56 2016 +0200
     2.2 +++ b/openssh/receipt	Tue Sep 20 16:04:52 2016 +0200
     2.3 @@ -50,8 +50,17 @@
     2.4  	sed -i 's|/usr/libexec/sftp-server|/usr/sbin/sftp-server|' \
     2.5  		$fs/etc/ssh/sshd_config
     2.6  
     2.7 -	# client bug CVE-2016-0777 and CVE-2016-0778
     2.8 -	echo -e '\nHost *\n  UseRoaming no' >> $fs/etc/ssh/ssh_config
     2.9 +	cat >> $fs/etc/ssh/ssh_config <<EOT
    2.10 +
    2.11 +# client bug CVE-2016-0777 and CVE-2016-0778
    2.12 +Host *
    2.13 +  UseRoaming no
    2.14 +
    2.15 +# From https://wiki.gentoo.org/wiki/SSH_jump_host  
    2.16 +Host *+*
    2.17 +  ProxyCommand ssh $(echo %h | sed 's/+[^+]*$//;s/\([^+%%]*\)%%\([^+]*\)$/\2 -l \1/;s/:/ -p /') exec nc -w1 $(echo %h | sed 's/^.*+//;/:/!s/$/ %p/;s/:/ /')
    2.18 +
    2.19 +EOT
    2.20  }
    2.21  
    2.22  post_install()