Skip to content

Instantly share code, notes, and snippets.

@seifrajhi
Last active May 5, 2022 11:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seifrajhi/3becd2ac999f067e20216fa899456089 to your computer and use it in GitHub Desktop.
Save seifrajhi/3becd2ac999f067e20216fa899456089 to your computer and use it in GitHub Desktop.
FROM rajhisaifeddine/ubuntu-ssh-server
MAINTAINER Saifeddine RAJHI "https://gist.github.com/seifrajhi/"
# create user - ansible - for ssh access and enable sudo operations
RUN apt-get update && \
apt-get -y install sudo && \
groupadd -r ansible && \
useradd -rmg ansible ansible && \
echo 'ansible:ansible' |chpasswd && \
echo 'ansible ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers && \
ln /usr/bin/python3 /usr/bin/python && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN su - ansible -c "mkdir ~/.ssh"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment