Cannot get SFTP work in FreeBSD 12.4 Jails

C

cb000

Guest
Hi, I am new to this forum.

In FreeBSD 12.3 Jail, I can easily to activate SSH server my the following command:
sysrc sshd_enable=YES && \
service sshd start


After that, I import my public key to user and I can use SSH / SFTP to connect to the Jail.

However, in FreeBSD 12.4, my steps can only make SSH works. It does not make SFTP to work.

In WinSCP, it show the following error message (I deleted the SSH part):
WinSCP Error Log
Code:
. 2023-06-26 03:06:13.862 --------------------------------------------------------------------------
. 2023-06-26 03:06:13.863 Using SFTP protocol.
. 2023-06-26 03:06:13.863 Doing startup conversation with host.
. 2023-06-26 03:06:13.863 Session upkeep
. 2023-06-26 03:06:13.863 Looking for network events
. 2023-06-26 03:06:13.863 Detected network event
. 2023-06-26 03:06:13.863 Enumerating network events for socket 1888
. 2023-06-26 03:06:13.863 Enumerated 1 network events making 1 cumulative events for socket 1888
. 2023-06-26 03:06:13.863 Handling network read event on socket 1888 with error 0
> 2023-06-26 03:06:13.878 Type: SSH_FXP_INIT, Size: 5, Number: -1
> 2023-06-26 03:06:13.878 01,00,00,00,06,
. 2023-06-26 03:06:13.878 Sent 9 bytes
. 2023-06-26 03:06:13.878 There are 0 bytes remaining in the send buffer
. 2023-06-26 03:06:13.878 Looking for network events
. 2023-06-26 03:06:13.878 Timeout waiting for network events
. 2023-06-26 03:06:13.878 Waiting for another 4 bytes
. 2023-06-26 03:06:13.878 Looking for incoming data
. 2023-06-26 03:06:13.878 Looking for network events
. 2023-06-26 03:06:13.878 Session sent command exit status 255
. 2023-06-26 03:06:13.878 Main session channel closed
. 2023-06-26 03:06:13.878 All channels closed
. 2023-06-26 03:06:13.878 Timeout waiting for network events
. 2023-06-26 03:06:13.878 Waiting for another 4 bytes
. 2023-06-26 03:06:13.878 Looking for incoming data
. 2023-06-26 03:06:13.878 Looking for network events
. 2023-06-26 03:06:13.878 Attempt to close connection due to fatal exception:
* 2023-06-26 03:06:13.878 **Connection has been unexpectedly closed.** Server sent command exit status 255.
. 2023-06-26 03:06:13.878 Closing connection.
. 2023-06-26 03:06:13.878 Selecting events 0 for socket 1888
* 2023-06-26 03:06:13.907 (EFatal) **Connection has been unexpectedly closed.** Server sent command exit status 255.
* 2023-06-26 03:06:13.907 Cannot initialize SFTP protocol. Is the host running an SFTP server?
Error in Jail /var/log/messages
Code:
Jun 25 18:06:13 testjail sftp-server[48037]: fatal: unable to make the process untraceable: No such process

Host: TrueNAS 12.0U8.1 (FreeBSD 12.2-RELEASE-p14)
Jail: FreeBSD 12.4-RELEASE-p3
 
Why not take the easy route and use scp instead of sftp?

Syntax is pretty simple. You have keys already setup.
scp -r /gpiolcd/ 192.168.1.134:/root/
 
Why not take the easy route and use scp instead of sftp?

Syntax is pretty simple. You have keys already setup.
scp -r /gpiolcd/ 192.168.1.134:/root/
Many thanks, this solve the problem.
However, I still don't know why SFTP is not work in 12.4.
 
hosts.allow(5)

but as SirDice pointed out: FreeNAS isn't supported. In this case (and many others) because the normal and sane way of configuring things won't apply, because they constantly overwrite or delete manual configurations. So anything not accounted for by their GUI won't work. For a proper general-purpose server OS, just use vanilla FreeBSD.
 
Whats pretty strange to me is that FreeNAS is using 12.x while pfSense is using -CURRENT..........

A popular firewall using -CURRENT and NAS using older branch.
 
I am sorry for being the guy that knowingly helps these unsupported users.
This case was pretty simple recommendation.

I try not involve myself on their quest however ridiculus. I just hate seeing people stranded on something simple.
I just see words like WinSCP and think back to when I was trying to adapt from a Windows and pfSense world.
 
Well, it's a bad idea to run a newer version of a jail than the host in any case. A 12.3 or 12.4 jail on a host with a 12.2 kernel is a bad idea to begin with.
 
Back
Top