Hello,
I have some strange behavior with sftp (sshd), maybe after some update I loosed access to chroot directory.
My system is:
And my part of sshd_conf is:
And my home folder:
Before chroot working well...
But now when I connect to my server via sftp I can't list directory
In FileZilla I have this message:
I can connect but can't list the directory.
In log I can see only:
If I comment "ChrootDirectory /home/user/ftp" parameter, SFTP server start to work good.
Best regards,
I have some strange behavior with sftp (sshd), maybe after some update I loosed access to chroot directory.
My system is:
Code:
# uname -a
FreeBSD 12.1-RELEASE FreeBSD 12.1-RELEASE r354233 GENERIC arm64
And my part of sshd_conf is:
Code:
# override default of no subsystems
#Subsystem sftp /usr/libexec/sftp-server
Subsystem sftp internal-sftp -l DEBUG -f AUTH
# Example of overriding settings on a per-user basis
Match Group user
ChrootDirectory /home/user/ftp
ForceCommand internal-sftp -l DEBUG -f AUTH
X11Forwarding no
AllowTcpForwarding no
PermitTunnel no
PermitTTY no
And my home folder:
Code:
# ls -l /home/
drwxr-xr-x 3 root wheel 512 Sep 27 15:07 user
# ls -l /home/user/
drwxr-xr-x 4 root wheel 512 Nov 1 2019 ftp
Before chroot working well...
But now when I connect to my server via sftp I can't list directory
In FileZilla I have this message:
Code:
Connecting to 172.16.0.1...
Status: Connected to 172.16.0.1
Status: Retrieving directory listing...
Status: Listing directory /
Error: Connection timed out after 20 seconds of inactivity
Error: Failed to retrieve directory listing
I can connect but can't list the directory.
In log I can see only:
Code:
Changed root directory to "/home/user/ftp"
debug1: rekey after 4294967296 blocks
debug1: rekey after 4294967296 blocks
debug1: ssh_packet_set_postauth: called
debug1: active: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
debug1: Entering interactive session for SSH2.
debug1: server_init_dispatch
debug1: server_input_channel_open: ctype session rchan 256 win 2147483647 max 16384
debug1: input_session_request
debug1: channel 0: new [server-session]
debug1: session_new: session 0
debug1: session_open: channel 0
debug1: session_open: session 0: link with channel 0
debug1: server_input_channel_open: confirm session
debug1: server_input_channel_req: channel 0 request simple@putty.projects.tartarus.org reply 0
debug1: session_by_channel: session 0 channel 0
debug1: session_input_channel_req: session 0 req simple@putty.projects.tartarus.org
debug1: server_input_channel_req: channel 0 request subsystem reply 1
debug1: session_by_channel: session 0 channel 0
debug1: session_input_channel_req: session 0 req subsystem
debug1: subsystem: internal-sftp
Starting session: forced-command (config) 'internal-sftp -l DEBUG -f AUTH' for user from 192.168.0.106 port 34978 id 0
If I comment "ChrootDirectory /home/user/ftp" parameter, SFTP server start to work good.
Best regards,