Created
March 5, 2014 04:38
-
-
Save nojima/9361260 to your computer and use it in GitHub Desktop.
ssh to an LXC container.
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
#!/bin/sh -e | |
if [ "$1" = "" ]; then | |
echo "Usage: lxc-ssh NAME [ARGS]" | |
exit 1 | |
fi | |
NAME=$1 | |
ADDR=$(sudo lxc-info -n $NAME | awk -F': *' '/^IP:/ { print $2 }') | |
shift | |
exec ssh -l ubuntu -o StrictHostKeyChecking=no $ADDR $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment