Skip to content

Instantly share code, notes, and snippets.

@jrwren
Forked from anonymous/Dockerfile
Last active August 4, 2016 19:40
Show Gist options
  • Save jrwren/432ae09729fb7087871a29e93d0d1a3c to your computer and use it in GitHub Desktop.
Save jrwren/432ae09729fb7087871a29e93d0d1a3c to your computer and use it in GitHub Desktop.
FROM ubuntu:16.04
# Set correct environment variables.
ENV HOME /root
ENV PORT 2222
ENV HOSTNAME pair.dasapp.co
RUN apt update && apt install -y software-properties-common
# Use libssh 0.7 https://github.com/tmate-io/tmate/issues/82#issuecomment-216165761
RUN add-apt-repository -u ppa:kedazo/libssh-0.7.x
RUN add-apt-repository -u ppa:tmate.io/archive
RUN add-apt-repository -u ppa:evarlast/experimental
RUN apt -y install tmate-slave && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# impl in progress
CMD ["./tmate-get-fingerprints.sh"]
#!/bin/sh
DSA=`ssh-keygen -l -f /opt/tmate-slave/keys/ssh_host_dsa_key 2>&1 | cut -d\ -f 2`
RSA=`ssh-keygen -l -f /opt/tmate-slave/keys/ssh_host_rsa_key 2>&1 | cut -d\ -f 2`
ECDSA=`ssh-keygen -l -f /opt/tmate-slave/keys/ssh_host_ecdsa_key 2>&1 | cut -d\ -f 2`
echo Add this to your ~/.tmate.conf file
echo set -g tmate-server-host \"$HOSTNAME\"
echo set -g tmate-server-port \"$PORT\"
echo set -g tmate-server-rsa-fingerprint \"$RSA\"
echo set -g tmate-server-dsa-fingerprint \"$DSA\"
echo set -g tmate-server-ecdsa-fingerprint \"$ECDSA\"
echo set -g tmate-identity \"\" # Can be specified to use a different SSH key.
/opt/tmate-slave/tmate-slave -h $HOSTNAME -p $PORT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment