On Thu, Aug 1, 2024 at 8:41 AM 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?mark, this is a systemd list, people here may know about openssh but it is not the right place to ask
Hello Cristian
My reason for posting to the systemd list is because this currently looks like a systemd issue and not an openssh issue. Sorry if I didn't make that clear:
Some 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.
My investigation so far shows that the systemd socket service listens for incoming ssh connections, accepts incoming connections and prepares to spawn the sshd service, but somewhere during this process the socket gets closed before sshd is spawned. Tracing through the systemd code shows that the socket has been closed by the time getpeername is called in service_spawn (the call fails with ENOTCONN). This is immediately before systemd attempts to spawn the sshd process in src/core/service.c.
Regards
Mark
On Sat, 3 Aug 2024 at 18:25, Cristian Rodríguez <crrodriguez@xxxxxxxxxxxx> wrote:
On Thu, Aug 1, 2024 at 8:41 AM 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?mark, this is a systemd list, people here may know about openssh but it is not the right place to ask.I can't see anything obvious in either the systemd source that suggests a dependency on bash.IF systemd wants bash, it would explicitly call /bin/bash or have scripts with the proper shebang. otherwise a posix compatible shell should work.
Shells that are widely tested as default are bash and dash, stick to one of those.
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