From 68b88939bbfba99dfc22a466a7c6ffae81781c90 Mon Sep 17 00:00:00 2001 From: Pierre Mauduit Date: Fri, 20 Dec 2024 15:38:58 +0100 Subject: [PATCH] feat: sftp-server - installing uuid-runtime debian package uuid-runtime can be useful as it provides the uuidgen command which can be used in bash scripts for e.g. generating uuids, when migrating geOrchestra LDAP trees for example. --- sftp-server/build.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/sftp-server/build.sh b/sftp-server/build.sh index 3bca05c..9fe4f74 100755 --- a/sftp-server/build.sh +++ b/sftp-server/build.sh @@ -7,23 +7,23 @@ apt update apt install -y --no-install-recommends --no-install-suggests openssh-server rm -f /etc/ssh/ssh_host_*_key* -mkdir /var/run/sshd /etc/ssh/ssh_host_keys -sed -i -e 's@#HostKey /etc/ssh/ssh_host@HostKey /etc/ssh/ssh_host_keys/ssh_host@g' /etc/ssh/sshd_config -echo "AllowUsers sftp" >> /etc/ssh/sshd_config -echo "PasswordAuthentication no" >> /etc/ssh/sshd_config -cp /etc/ssh/sshd_config /etc/ssh/sshd_config.client -sed -i -e 's@^Subsystem sftp .*@Subsystem sftp internal-sftp@' /etc/ssh/sshd_config.client -echo "Match User sftp" >> /etc/ssh/sshd_config.client -echo " AllowTcpForwarding no" >> /etc/ssh/sshd_config.client -echo " X11Forwarding no" >> /etc/ssh/sshd_config.client +mkdir /var/run/sshd /etc/ssh/ssh_host_keys +sed -i -e 's@#HostKey /etc/ssh/ssh_host@HostKey /etc/ssh/ssh_host_keys/ssh_host@g' /etc/ssh/sshd_config +echo "AllowUsers sftp" >> /etc/ssh/sshd_config +echo "PasswordAuthentication no" >> /etc/ssh/sshd_config +cp /etc/ssh/sshd_config /etc/ssh/sshd_config.client +sed -i -e 's@^Subsystem sftp .*@Subsystem sftp internal-sftp@' /etc/ssh/sshd_config.client +echo "Match User sftp" >> /etc/ssh/sshd_config.client +echo " AllowTcpForwarding no" >> /etc/ssh/sshd_config.client +echo " X11Forwarding no" >> /etc/ssh/sshd_config.client echo " ForceCommand internal-sftp" >> /etc/ssh/sshd_config.client # Add user tools - + apt install -y --no-install-recommends --no-install-suggests \ groff rsync vim-nox emacs-nox screen gdal-bin pktools wget curl file \ python3-gdal nano git htop sudo tree less bash-completion zsh figlet colordiff unzip \ - python3 dnsutils ldap-utils postgresql-common + python3 dnsutils ldap-utils postgresql-common uuid-runtime # configure postgresql apt repository (PGDG) # see https://wiki.postgresql.org/wiki/Apt @@ -43,4 +43,4 @@ useradd -r -d /home/sftp --shell /bin/bash sftp mkdir -p /home/sftp.skel/.ssh chown -R sftp.sftp /home/sftp.skel ln -s /mnt /home/sftp.skel/data -adduser sftp sudo \ No newline at end of file +adduser sftp sudo