From 3bff74a4032590a712e8478b2e6f55e6e68bc2b2 Mon Sep 17 00:00:00 2001 From: Ricard Illa Date: Sun, 4 Sep 2022 18:38:12 +0200 Subject: [PATCH] handle ubuntu's sftp path --- roles/sshd/templates/sshd_config.j2 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/roles/sshd/templates/sshd_config.j2 b/roles/sshd/templates/sshd_config.j2 index 27cc473..e73ef4b 100644 --- a/roles/sshd/templates/sshd_config.j2 +++ b/roles/sshd/templates/sshd_config.j2 @@ -108,9 +108,14 @@ X11Forwarding no # override default of no subsystems {% if ansible_distribution == "OpenBSD" %} -Subsystem sftp /usr/libexec/sftp-server +Subsystem sftp /usr/libexec/sftp-server +{% elif ansible_distribution == "Alpine" %} +Subsystem sftp /usr/lib/ssh/sftp-server +{% elif ansible_distribution == "Ubuntu" %} +Subsystem sftp /usr/lib/openssh/sftp-server {% else %} -Subsystem sftp /usr/lib/ssh/sftp-server +# I don't know what OS that is, Ansible guessed on using the same config as Alpine +Subsystem sftp /usr/lib/ssh/sftp-server {% endif %} # Example of overriding settings on a per-user basis