I assume you mean the inetd-style sshd@.service, not the regular sshd.service? (Or does your distribution patch systemd-style socket activation into sshd?)
There is usually no dependency on a shell, unless the .service unit explicitly calls /bin/sh (note that the inetd-style socket activation uses a different .service). Forkstat or extrace can reveal what is being exec'd when the connection is made.
On Thu, Aug 1, 2024, 15:40 Mark Corbin <mcorbin@xxxxxxxxxxxxxxx> wrote:
HelloI was wondering whether anybody has any experience of running the sshd service successfully on a system with a 'non-bash' shell?We're using systemd 250.5 and openssh 8.9p1. Both ssh and scp work as expected with '/bin/sh -> bash.bash' on the target, but with '/bin/sh -> busybox.nosuid' (ash shell) the connections fail.The sshd logs on the target show:Jul 31 15:24:56 hc sshd[17826]: Connection from UNKNOWN port 65535 on 192.168.12.246 port 65535
Jul 31 15:24:56 hc sshd[17826]: debug1: kex_exchange_identification: write: Broken pipe
Jul 31 15:24:56 hc sshd[17826]: banner exchange: Connection from UNKNOWN port 65535: Broken pipeSome extra debug messages that I've added to both systemd and sshd show that the incoming socket gets closed somewhere between the handover from the systemd socket service to the systemd sshd service. This results in sshd being unable to get any peer details. The call to getpeername in service_spawn fails with ENOTCONN.I can't see anything obvious in either the systemd source that suggests a dependency on bash.Any ideas gratefully appreciated.RegardsMark--
C2:Restricted unless otherwise stated.
Lunar Energy Limited is a company registered in England and Wales, authorised and regulated by the Financial Conduct Authority under reference number 767876. Company registration number: 05631091. Registered office: 55 Baker Street, London, England, W1U 7EU