Skip to content

Instantly share code, notes, and snippets.

@dongwooklee96
Created May 20, 2021 03:12
Show Gist options
  • Save dongwooklee96/71002d131ae3a66c35ce1ab2e4816dd9 to your computer and use it in GitHub Desktop.
Save dongwooklee96/71002d131ae3a66c35ce1ab2e4816dd9 to your computer and use it in GitHub Desktop.
CLION REMOTE CONFIG
FROM ubuntu:18.04
########################################################
# Essential packages for remote debugging and login in
########################################################
RUN apt-get update && apt-get upgrade -y && apt-get install -y \
apt-utils gcc g++ openssh-server cmake build-essential gdb gdbserver rsync vim
RUN mkdir /var/run/sshd
RUN echo 'root:root' | chpasswd
RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
# SSH login fix. Otherwise user is kicked off after login
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
ENV NOTVISIBLE "in users profile"
RUN echo "export VISIBLE=now" >> /etc/profile
# 22 for ssh server. 7777 for gdb server.
EXPOSE 22 7777
RUN useradd -ms /bin/bash debugger
RUN echo 'debugger:pwd' | chpasswd
########################################################
# Add custom packages and development environment here
########################################################
########################################################
CMD ["/usr/sbin/sshd", "-D"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment