Last active
June 2, 2022 03:49
-
-
Save nhtzr/ba4caab8a937f4cdf4fb546350d1222b to your computer and use it in GitHub Desktop.
my .ssh/config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Host */* | |
| ProxyCommand ssh %r@$(dirname %h) -W $(basename %h):%p | |
| Host *_* | |
| ProxyCommand ssh %r@$(cut -f1 -d_ <<< '%h') -W $(: '%h'; echo "${_##*_}"):%p | |
| # SSH over Session Manager | |
| Host aws-ssm-* | |
| ProxyCommand sh -c "aws ssm start-session --target %h --document-name AWS-StartSSHSession --parameters 'portNumber=%p'" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment