Ssh
Config¶
Config example
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/github_rsa
AddKeysToAgent yes
SSH-agent¶
Small project to help to persist and handle ssh-agent on each ssh login
Proxy¶
Set up an ssh bastion proxy
function sshproxy()
{
if [ $# -lt 1 ]; then
echo "Usage: $0 [host] [?USER]"
else
ssh -o ProxyCommand="ssh -W %h:%p ubuntu@host -i ~/.ssh/key.pem" ${2:='ubuntu'}@$1 -i ~/.ssh/key
fi
}
Tunnel¶
ssh -L 3899:localhost:389 vboissiere@server
Vagrant tunnel
vg ssh -- -R 3899:localhost:3899