Created
February 17, 2017 18:30
-
-
Save brevans/763964b4bdbae66cede676f781bf6b5d to your computer and use it in GitHub Desktop.
openssh config to allow sharing of multiple sessions over a single network connection
This file contains 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
#!/bin/bash | |
if [ ! -f ~/.ssh/config ]; then | |
touch ~/.ssh/config | |
chmod 644 ~/.ssh/config | |
fi | |
mkdir -p ~/.ssh/tmp | |
if grep -iq 'ControlMaster' ~/.ssh/config; then | |
echo "ControlMaster options already set, please check ~/.ssh/config" | |
else | |
sed -i.bak "1s@^@ControlMaster auto\nControlPath ${HOME}/.ssh/tmp/%h_%p_%r\n\n@" ~/.ssh/config | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment