hestiacp icon indicating copy to clipboard operation
hestiacp copied to clipboard

[Bug] sftp connection Exit status 127 on fresh installed HESTIA v1.9.3 on Ubuntu 22.04

Open estratos opened this issue 1 year ago • 5 comments

Describe the bug

After a fresh install of Hestia on Ubuntu 22.04, users cannot connect by the sftp protocol

After a pair of hours lookig I found out the cause in:

/etc/ssh/sshd_config

# override default of no subsystems Subsystem sftp internal-sftp-server

changed to make it work

# override default of no subsystems Subsystem sftp internal-sftp

Tell us how to replicate the bug

1.- Fresh install Hestia on Ubuntu 22.04, update && upgrade first 2.-Create some test users 3.- You will get Exit status 127 from remote client

Which components are affected by this bug?

Control Panel Installation or Upgrade

Hestia Control Panel Version

1.9.3

Operating system

Ubuntu 22.04

Log capture

debug1: client_input_hostkeys: hostkeys file /root/.ssh/known_hosts2 does not exist
debug1: client_input_hostkeys: no new or deprecated keys from server
debug2: channel_input_open_confirmation: channel 0: callback start
debug2: fd 3 setting TCP_NODELAY
debug2: client_session2_setup: id 0
debug1: Sending environment.
debug1: channel 0: setting env LANG = "en_US.UTF-8"
debug2: channel 0: request env confirm 0
debug1: Sending subsystem: sftp
debug2: channel 0: request subsystem confirm 1
debug1: pledge: fork
debug2: channel_input_open_confirmation: channel 0: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel 0: rcvd adjust 2097152
debug2: channel_input_status_confirm: type 99 id 0
debug2: subsystem request accepted on channel 0
debug2: channel 0: rcvd eof
debug2: channel 0: output open -> drain
debug2: channel 0: obuf empty
debug2: chan_shutdown_write: channel 0: (i0 o1 sock -1 wfd 5 efd 6 [write])
debug2: channel 0: output drain -> closed
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype [email protected] reply 0
debug2: channel 0: rcvd eow
debug2: chan_shutdown_read: channel 0: (i0 o3 sock -1 wfd 4 efd 6 [write])
debug2: channel 0: input open -> closed
debug2: channel 0: rcvd close
debug2: channel 0: almost dead
debug2: channel 0: gc: notify user
debug2: channel 0: gc: user detached
debug2: channel 0: send close
debug2: channel 0: is dead
debug2: channel 0: garbage collecting
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 3224, received 3664 bytes, in 0.2 seconds
Bytes per second: sent 20853.1, received 23699.0
debug1: Exit status 127
Connection closed.
Connection closed

estratos avatar Mar 07 '25 11:03 estratos

I'm having the same issue. It is likely related to the subnets. When your server has multiple IP addresses on different subnets, SFTP communication between devices on separate subnets can be blocked if routing is not correctly set up. Ensure the server and client are either on the same subnet or configure the router to allow routing between the subnets.

Current communication is only allowed for internal subnets. I'm not sure if it's a bug or intentionally configured by the HestiaCP team.

seferdemirci avatar Mar 08 '25 12:03 seferdemirci

Issue fixed in release 1.9.3 - Service release #4859 , closing issue

estratos avatar Mar 16 '25 06:03 estratos

The problem also occurs in 24.04.2 fresh install and Hestia (1.9.3). Should I reopen a new bug report?

The fix is ​​the same: sudo sed -i 's|^Subsystem.*|Subsystem sftp internal-sftp|' /etc/ssh/sshd_config

thomas-berrio avatar May 07 '25 08:05 thomas-berrio

yup still exist, same setups as @thomas-berrio

in my case it happen after i allow ssh access to the user.

touringlobal avatar May 19 '25 03:05 touringlobal

This also happens on Debian 12. (hestia v1.9.4) Changing to "Subsystem sftp internal-sftp" fixes it.

IlianV avatar Sep 12 '25 14:09 IlianV