SFTP in Fedora 39 does not work with default config using sftp-server

I was trying to sftp to my Fedora 39 workstation. Authentication succeeds but sftp failed, with error on the client side: “Unable to open SFTP session”. I see that /etc/ssh/sshd_config contains:

Subsystem      sftp    /usr/libexec/openssh/sftp-server

I don’t see any reason in the logs for why the connection fails. There are no selinux failures or any other errors that I can see.

When changing Subsystem to:

Subsystem      sftp    internal-sftp

it works fine! However, according to this issue, it is not as secure.

I’m using the internal server for now, but anyone have any ideas on how to get /usr/libexec/openssh/sftp-server to work?

This works for me between an updates f38 to an updated f39.
I’m using my ed25519 ID that is setup on the f39 machine.

What OS are you using sftp from?
Does ssh work?

What is the output of sftp -vvv <host>?

1 Like

Thank you, sftp -vvv shows the reason for the failure – I recently switched my default shell to fish, and fish was producing output at login time even though non-interactive:

Received message too long 167772161
Ensure the remote shell produces no output for non-interactive sessions.

Adding a strategic snippet to my config.fish fixed the problem:

if not status --is-interactive
  exit
end

Thanks!

1 Like