You are not logged in.

#1 2020-05-06 08:54:44

Malstrond
Member
From: Germany
Registered: 2009-06-03
Posts: 96

[Solved] SSH fails with "error: openpty: No such file or directory"

I have a system that I can't ssh into anymore.
SSH fails with the following error being logged by sshd:

sshd[826]: error: openpty: No such file or directory
sshd[826]: error: session_pty_req: session 0 alloc failed

/dev/pts is mounted according to mount:

devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)

but it is empty. Should it be empty?
/dev/ptmx also exists.

What do I have to look at to debug this?
I already tried running sshd in debug mode (-Dddd) but it just outputs the same error message.

Last edited by Malstrond (2020-05-20 17:12:03)

Offline

#2 2020-05-06 14:30:18

fvsc
Member
From: Antwerp, Belgiun
Registered: 2009-10-31
Posts: 14

Re: [Solved] SSH fails with "error: openpty: No such file or directory"

I have the same problem and I have a work around:

ssh <servername> "/bin/bash -i"
mount -t devpts devpts /dev/pts
exit

ssh <servername> and fault is gone.

But after a reboot the problem is back.

Why, I don't know and I also do have a real solution.

Last edited by fvsc (2020-05-06 14:33:09)

Offline

#3 2020-05-18 17:20:07

Malstrond
Member
From: Germany
Registered: 2009-06-03
Posts: 96

Re: [Solved] SSH fails with "error: openpty: No such file or directory"

Solved on my end.

The root cause was this dhcpcd bug for me. Switching to another DHCP client solved it.

Last edited by Malstrond (2020-05-18 17:21:04)

Offline

#4 2020-05-19 10:08:24

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 8,201

Re: [Solved] SSH fails with "error: openpty: No such file or directory"

Glad you found a workaround*, please prepend [workedaround] to the topic title.


*
I'm suggesting workedaround instead of solved as https://bugs.archlinux.org/task/66405 suggests the root cause is NOT upstream dhcpcd.

Last edited by Lone_Wolf (2020-05-19 10:09:33)


Multi-init booting with apg Openrc and systemd coexisting
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them

Offline

#5 2020-05-21 12:30:51

fvsc
Member
From: Antwerp, Belgiun
Registered: 2009-10-31
Posts: 14

Re: [Solved] SSH fails with "error: openpty: No such file or directory"

I downgraded dhcpcd 9.0.2-1 to dhcpcd 8.1.7-1 and the problem is solved.

Offline

#6 2020-05-21 13:04:26

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 9,983

Re: [Solved] SSH fails with "error: openpty: No such file or directory"

A real fix instead of downgrading is double checking that you do not have multiple daemons spawned for the same network controller, in  practice this often means that you have both the dhcpcd and the dhcpcd@interface.service enabled, while you should only have one of the two. It's not entirely clear why this situation lead to this fall out, but this situation has always been warned against and is known to lead to undefined behaviour

Offline

#7 2020-05-22 18:56:04

fvsc
Member
From: Antwerp, Belgiun
Registered: 2009-10-31
Posts: 14

Re: [Solved] SSH fails with "error: openpty: No such file or directory"

dhcpcd.service is disabled
dhcpcd@enp3s0.service is enabled  and is started
dhcpcd@enp4s0.service is enabled but timed out and Failed to start dhcpcd on enp4s0 which is OK because no network cable connected

I have disabled dhcpcd@enp4s0.service (with no network cable)
Upgraded to dhcpcd 9.0.2-1

Booted and problem solved.

Thanks for the hint.

Offline

Board footer

Powered by FluxBB