Skip to content

Instantly share code, notes, and snippets.

@luksa
Last active August 29, 2015 14:02
Show Gist options
  • Save luksa/d95ecf318b5e57f811bd to your computer and use it in GitHub Desktop.
Save luksa/d95ecf318b5e57f811bd to your computer and use it in GitHub Desktop.
ssh into fabric8 docker container by container id (e.g. sshf 5043fb)
#/bin/sh
# Store this into a file called "sshf" and do a chmod +x on it.
# Then simply do a "docker ps" to see the container id and then invoke "sshf <container id>" to ssh into
# that container
echo ssh-ing to docker container $1 \(port `docker port $1 22 | sed 's/.*://'`\)
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o PreferredAuthentications=password fabric8@localhost -p `docker port $1 22 | sed 's/.*://'`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment