Désolé pour le formatage de la réponse, sur mon téléphone je n’arrive pas trop à le faire…
Mon fichier sshd :
Match User user1,user2
ChrootDirectory /home/%u
X11Forwarding no
ForceCommand internal-sftp -l VERBOSE -f LOCAL6
Si comme dans mon cas, les utilisateurs ne sont pas dans le root filesystem. Il faut modifier le fichier syslog ou rsyslog :
# For SFTP blogging
local6.* /var/log/sftp.log
# Create an additional socket for some of the sshd chrooted users.
$AddUnixListenSocket /home/sftp.log.socket
# Log internal-sftp in a separate file
:programname, isequal, “internal-sftp” -/var/log/sftp.log
:programname, isequal, “internal-sftp” ~
Explication : You will see verbose sftp logging seing produced in the /var/logmessages for each chroot’ed user, where by default this should go to the daemon.log. The reason for this is that the chroot’ed sftp process can not open /dev/log as this is not within the chrooted filesystem.
Chaque utilisateur doit avoir son log :
mkdir /home/user1/dev
chmod 755 /home/user1/dev
ln /home/sftp.log.socket /home/user1/dev/log
Puis relancer les services SSH et RSYSLOG.
Par contre, les messages sont en doubles dans le sftp.log je ne sais pas encore trop pourquoi.
En espérant que cela fonctionne chez toi,
Si tu as des questions, n’hésite pas.
Robin