my_webapp_ynh/conf/ssh_regenconf_hook

21 lines
398 B
Bash

#!/bin/bash
action=$1
pending_dir=$4
ssh_conf=$pending_dir/../ssh/etc/ssh/sshd_config
[[ $action == "pre" ]] || exit 0
[[ -e $ssh_conf ]] || exit 0
echo "
##-> __APP__
# Hardening user connection
Match User __APP__
ChrootDirectory %h
ForceCommand internal-sftp
AllowTcpForwarding no
PermitTunnel no
X11Forwarding no
PasswordAuthentication yes
##<- __APP__" >> $ssh_conf