[Git][debian-proftpd-team/proftpd][master] 2 commits: Add a regression test for SFTP connections
Hilmar Preuße (@hilmar)
hille42 at debian.org
Mon May 26 13:43:31 BST 2025
Hilmar Preuße pushed to branch master at Debian ProFTPD Team / proftpd
Commits:
7f4aee5d by Lucas Kanashiro at 2025-05-16T18:21:12-03:00
Add a regression test for SFTP connections
- - - - -
0d53eccb by Hilmar Preuße at 2025-05-26T12:43:28+00:00
Merge branch 'master' into 'master'
Add a regression test for SFTP connections
See merge request debian-proftpd-team/proftpd!11
- - - - -
2 changed files:
- debian/tests/control
- + debian/tests/sftp-connection
Changes:
=====================================
debian/tests/control
=====================================
@@ -8,3 +8,7 @@ Depends: @builddeps@,
libhttp-message-perl,
redis-server
Restrictions: allow-stderr
+
+Tests: sftp-connection
+Depends: @, adduser, openssh-client, openssh-server
+Restrictions: allow-stderr, needs-root, isolation-machine
=====================================
debian/tests/sftp-connection
=====================================
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+set -x
+
+# Add local user
+adduser --disabled-password --gecos "" sftp-user
+
+# Configure SFTP
+cat <<EOF >/etc/proftpd/conf.d/sftp.conf
+<IfModule mod_sftp.c>
+ SFTPEngine on
+ Port 2222
+ SFTPLog /var/log/proftpd/sftp.log
+ SFTPHostKey /etc/ssh/ssh_host_rsa_key
+ SFTPAuthMethods publickey
+ SFTPAuthorizedUserKeys file:/etc/proftpd/authorized_keys/%u
+ DefaultRoot ~
+ RequireValidShell off
+ SFTPCompression delayed
+</IfModule>
+EOF
+
+# Restart service
+systemctl restart proftpd
+
+# Generate a key
+su - sftp-user -c "mkdir -p /home/sftp-user/.ssh"
+su - sftp-user -c "ssh-keygen -t rsa -b 4096 -N '' -f /home/sftp-user/.ssh/id_rsa"
+
+# Convert key to the correct format
+mkdir -p /etc/proftpd/authorized_keys/
+ssh-keygen -e -m RFC4716 -f /home/sftp-user/.ssh/id_rsa.pub | tee /etc/proftpd/authorized_keys/sftp-user
+
+# Try to connect via SFTP
+sftp -i /home/sftp-user/.ssh/id_rsa -o StrictHostKeyChecking=no -P 2222 sftp-user at localhost
View it on GitLab: https://salsa.debian.org/debian-proftpd-team/proftpd/-/compare/2d509c3189698aef24bb3dd75fddadf859c87eeb...0d53eccb3e755391b82e379a3b06ed569ee15a8a
--
View it on GitLab: https://salsa.debian.org/debian-proftpd-team/proftpd/-/compare/2d509c3189698aef24bb3dd75fddadf859c87eeb...0d53eccb3e755391b82e379a3b06ed569ee15a8a
You're receiving this email because of your account on salsa.debian.org.
More information about the Pkg-proftpd-maintainers
mailing list