Elffuss BraidHub

kikocis/continue public

0cbdfa622ced · 1.1 KiB · executableRawPermalink
1# create the docker file
2
3cat > Dockerfile << 'EOF'
4FROM ubuntu:latest
5ENV DEBIAN_FRONTEND=noninteractive
6# Install SSH server
7RUN apt-get update && apt-get install -y openssh-server
8# Configure SSH
9RUN mkdir /var/run/sshd
10RUN echo 'root:my_password' | chpasswd
11# Allow root login
12RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
13# SSH login fix
14RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
15EXPOSE 22
16CMD ["/usr/sbin/sshd", "-D"]
17EOF
18
19docker build -t continue-ubuntu-ssh . # build the image
20
21rm Dockerfile # remove the created Dockerfile
22
23container_name="continue-ssh-container"
24
25docker run -d -p 2222:22 --name $container_name continue-ubuntu-ssh # run the container
26
27echo "docker container ${container_name} running on port 2222"
28
29# add the instructions
30bold=$(tput bold)
31normal=$(tput sgr0)
32
33echo "\n--------------------------------------"
34echo "now ssh into vscode (using remote explorer) with the following command: ${bold}ssh root@localhost -p 2222${normal}"
35echo "use the following password - \"${bold}my_password${normal}\""