Skip to content
Snippets Groups Projects
Verified Commit 5ada3a28 authored by David Beniamine's avatar David Beniamine
Browse files

WIP sudoer

parent dfa3b9e3
No related branches found
No related tags found
No related merge requests found
...@@ -21,3 +21,6 @@ SPYDER=true ...@@ -21,3 +21,6 @@ SPYDER=true
ANACONDA=true ANACONDA=true
# Install QGIS # Install QGIS
QGIS=true QGIS=true
# Should the user have sudo rights
# **only home is a volume, any modifcation in other FS will be lost**
SUDO=true
...@@ -16,6 +16,7 @@ services: ...@@ -16,6 +16,7 @@ services:
- QGIS=${QGIS} - QGIS=${QGIS}
- ANACONDA=${ANACONDA} - ANACONDA=${ANACONDA}
- KASM_USER=${VNC_USER} - KASM_USER=${VNC_USER}
- SUDO=${SUDO}
image: "kasmvnc-ubuntu-noble:spyder-${SPYDER}_anaconda-${ANACONDA}_QGIS-${QGIS}" image: "kasmvnc-ubuntu-noble:spyder-${SPYDER}_anaconda-${ANACONDA}_QGIS-${QGIS}"
shm_size: '512m' shm_size: '512m'
volumes: volumes:
......
...@@ -12,6 +12,7 @@ ARG SPYDER ...@@ -12,6 +12,7 @@ ARG SPYDER
ARG QGIS ARG QGIS
ARG ANACONDA ARG ANACONDA
ARG ANACONDA_VERS=Anaconda3-2024.02-1 ARG ANACONDA_VERS=Anaconda3-2024.02-1
ARG SUDO
ARG KASM_USER ARG KASM_USER
...@@ -72,6 +73,15 @@ RUN if [ "$QGIS" = true ] ; then \ ...@@ -72,6 +73,15 @@ RUN if [ "$QGIS" = true ] ; then \
COPY custom_startup.sh $STARTUPDIR/custom_startup.sh COPY custom_startup.sh $STARTUPDIR/custom_startup.sh
COPY change_password.sh / COPY change_password.sh /
RUN if [ "$SUDO" = true ]; then \
echo "Defaults lecture_file = /etc/sudoers.lecture" > /etc/sudoers.d/kasm \
echo "%sudo ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/kasm; \
usermod -a -G sudo $KASM_USER \
fi
COPY lecture /etc/sudoers.lecture
######### End Customizations ########### ######### End Customizations ###########
......
################################### WARNING ###################################
Although you have root access, any change to the main file system will be
dropped upon container restart.
If you whish to install new softwares please contact the system administrator
for help.
###############################################################################
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment