FreeBSD 12.4 sudo 1.9.14 hang

sudo-1.9.13p3 から sudo-1.9.14p3 に更新すると、特定の1台のVM (13.2-RELEASE-p1) で頻繁にsudoがハングアップするようになりました。
sudo関係のプロセスが3個動いていて、末端のプロセスSIGKILLで止めると復旧しますが、それまではSSHログインも認証後プロンプトが表示されない等おかしな状態になります。
sudoers に Defaults !use_pty を設定すると問題が発生しなくなります。
ついでに、sudo実行の度にutx.logに記録されるようになるのも止まります。
まだサンプルは3台ですが、1台でしか問題が起きないのが良く分からないです。

https://www.facebook.com/groups/freebsd.labo.japan/posts/9952709514800856 2022-08-02

FreeBSD 12.4-RELEASE-p4 + udo-1.9.14p3 で同じ問題発生

The use_pty sudoers option is now enabled by default. To restore the historic behavior where a command is run in the user’s terminal, add Defaults !use_pty to the sudoers file. GitHub issue #258.

https://www.sudo.ws/releases/stable/#1.9.14

1.9.14で use_pty オプション(擬似 tty でコマンドを実行)がデフォルトで有効になったのが原因のようで sudoers に

Defaults !use_pty

を書いて無効にすると直る

It has been my intention to enable use_pty by default once the behavior of sudo with a pty is as close as possible to the behavior without one. With some recent bug fixes we may have reached that point. Some behavior will always be different, for example a command run in a pty will consume terminal input even if the command being run does not need it. There are probably still some minor issues (proxying signals and job control from one terminal to another adds complexity) but those bugs will be fixed as they are found. I will tentatively plan for sudo 1.9.14 to enable use_pty by default unless there is a major problem found in the meantime.

https://github.com/sudo-project/sudo/issues/258#issuecomment-1491039943

その他

sudoers
root ALL=(ALL) ALL

root ALL=(ALL:ALL) ALL
に変更

()内の右のALL
上記のグループ版。
(この:(コロン)以降書かなかった場合はグループ権限は自由に変えることはできない。それがALL = (ALL) ALL。グループのみを変更したい場合はALL = (:ALL) ALLってな感じでコロン付きで書く。)
【EC2】GitlabのインストールからSSL証明書の取得、リポジトリ移行までの手順 - Qiita 2015