Skip to content

Commit

Permalink
feat: sftp-server - installing uuid-runtime debian package
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pmauduit committed Dec 20, 2024
1 parent 11abd57 commit 68b8893
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions sftp-server/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
adduser sftp sudo

0 comments on commit 68b8893

Please sign in to comment.