Created
February 5, 2021 22:54
-
-
Save croepha/63551a79d7f4adb76f921c77df14467b to your computer and use it in GitHub Desktop.
sometimes you just want a bare ubuntu in a container to ssh to
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
v/entrypoint.bash | |
#!/bin/bash | |
#!/bin/bash | |
# sudo docker run "--env=SSH_KEY=$( ssh-add -L )" --name ssh1 --volume=$HOME/ssh1:/v '--entrypoint=/v/entrypoint.bash' -d ubuntu:20.04 | |
mount -t devtmpfs none /dev | |
mount -t devpts none /dev/pts | |
apt update | |
apt install -y openssh-server | |
(cd; umask 077 ; mkdir -p .ssh && echo "$SSH_KEY" >> .ssh/authorized_keys; ) | |
mkdir -p /run/sshd | |
/usr/sbin/sshd | |
echo "ASDF" | |
sleep 99999999999 | |
bash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment