[閒聊] FreeBSD 14.4 update sshd 會不見
freebsd-update fetch & install 後,版本為 freebsd 14.4 p6
跑完 install 後會有
Installing updates...install: ///usr/src/tests/sys/kern/tty: No such file or directory
Restarting sshd after upgrade
Performing sanity check on sshd configuration.
Stopping sshd.
Waiting for PIDS: 910.
Performing sanity check on sshd configuration.
Starting sshd.
/usr/libexec/sshd-auth does not exist or is not executable
/etc/rc.d/sshd: WARNING: failed to start sshd
done.
這時重開就沒 sshd 了,若是實體機沒 IPKVM 或者人不在面前,那就..
因為改呼叫 /usr/libexec/sshd-auth ,但升級後又沒有.
10.0p2
root@WEB-2026:/usr/ports/www/apache24 # ps uax | grep ssh
root 1538 0.0 0.0 25284 10208 - Is 00:56 0:00.01
sshd: /usr/sbin/sshd [listener] 0 of 10-100
root 2288 0.0 0.0 25792 12312 - Is 01:03 0:00.02
sshd-session: abc [priv] (sshd-session)
abc 2291 0.0 0.0 28352 13088 - S 01:04 0:01.31
sshd-session: abc@pts/0 (sshd-session)
9.9
root@dns1:~ # ps aux | grep sshd
root 798 0.0 0.0 23508 4428 - Ss 10May26 0:00.35
sshd: /usr/sbin/sshd [listener] 0 of 10-100 startups (sshd)
root 90192 0.0 0.1 24040 10192 - Is 02:41 0:00.02
sshd-session: abc [priv] (sshd-session)
abc 90195 0.0 0.1 24040 10484 - S 02:42 0:00.04
sshd-session: abc@pts/0 (sshd-session)
8.8
root@web:/tmp # ps aux | grep ssh
root 771 0.0 0.1 21096 8204 - Is Sat17 0:00.09
sshd: /usr/sbin/sshd [listener] 0 of 10-10
root 19328 0.0 0.1 21536 9676 - Is 23:07 0:00.02
sshd: abc [priv] (sshd)
abc 19331 0.0 0.1 21536 9936 - S 23:07 0:01.26
sshd: abc@pts/0 (sshd)
補救方法,非官方
down base
cd /tmp
mkdir bsdbase
cd bsdbase
wget https://download.freebsd.org/releases/amd64/amd64/14.4-RELEASE/base.txz
tar -xvJf base.txz
cd /tmp/bsdbase/usr/sbin
cp sshd /usr/sbin
cd /tmp/bsdbase/usr/libexec
cp sshd-* /usr/libexec/
/usr/sbin/sshd
telnet 0 22
Trying 0.0.0.0...
Connected to 0.
Escape character is '^]'.
SSH-2.0-OpenSSH_10.0 FreeBSD-20250801
quit
Invalid SSH identification string.
Connection closed by foreign host.
從 base.txz 放回去就是 10.0p2 了
[root@mail ~]# /usr/sbin/sshd -v
sshd: illegal option -- v
OpenSSH_10.0p2, OpenSSL 3.0.20 7 Apr 2026
usage: sshd [-46DdeGiqTtV] [-C connection_spec] [-c host_cert_file]
[-E log_file] [-f config_file] [-g login_grace_time]
[-h host_key_file] [-o option] [-p port] [-u len]
root@mail:~ # freebsd-version -ku
14.4-RELEASE-p5
14.4-RELEASE-p5
root@mail:~ # uname -a
FreeBSD mail.abc.com 14.4-RELEASE-p5 FreeBSD 14.4-RELEASE-p5 GENERIC amd64
root@mail:~ # telnet 0 22
Trying 0.0.0.0...
Connected to 0.
Escape character is '^]'.
SSH-2.0-OpenSSH_10.0 FreeBSD-20250801
quit
Invalid SSH identification string.
Connection closed by foreign host.
root@mail:~ # /usr/sbin/sshd -v
sshd: illegal option -- v
OpenSSH_10.0p2, OpenSSL 3.0.16 11 Feb 2025
usage: sshd [-46DdeGiqTtV] [-C connection_spec] [-c host_cert_file]
[-E log_file] [-f config_file] [-g login_grace_time]
[-h host_key_file] [-o option] [-p port] [-u le[A
14.4-RELEASE-p5 之前沒問題, 最近要更新的注意一下.
如果 /tmp/bsdbase 不能刪除,則要做以下處理
root@dns1:/tmp # rm -rf bsdbase/
rm: bsdbase/var/empty: Operation not permitted
rm: bsdbase/var: Directory not empty
rm: bsdbase/usr/bin/chpass: Operation not permitted
rm: bsdbase/usr/bin/su: Operation not permitted
rm: bsdbase/usr/bin/crontab: Operation not permitted
rm: bsdbase/usr/bin/login: Operation not permitted
rm: bsdbase/usr/bin/passwd: Operation not permitted
rm: bsdbase/usr/bin: Directory not empty
rm: bsdbase/usr: Directory not empty
rm: bsdbase/sbin/init: Operation not permitted
rm: bsdbase/sbin: Directory not empty
rm: bsdbase/libexec/ld-elf.so.1: Operation not permitted
rm: bsdbase/libexec/ld-elf32.so.1: Operation not permitted
rm: bsdbase/libexec: Directory not empty
rm: bsdbase/lib/libc.so.7: Operation not permitted
rm: bsdbase/lib/libcrypt.so.5: Operation not permitted
rm: bsdbase/lib/librt.so.1: Operation not permitted
rm: bsdbase/lib/libthr.so.3: Operation not permitted
rm: bsdbase/lib: Directory not empty
rm: bsdbase/: Directory not empty
root@dns1:/tmp # ls -lo bsdbase/sbin/init
-r-xr-xr-x 1 root wheel schg,uarch 1236656 Mar 6 18:34 bsdbase/sbin/init
root@dns1:/tmp # chflags -R noschg bsdbase/
root@dns1:/tmp # rm -rf bsdbase/
root@dns1:/tmp #
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.238.52.217 (日本)
※ 文章網址: https://www.ptt.cc/bbs/FreeBSD/M.1781895350.A.FF7.html
※ 編輯: asdfghjklasd (140.238.52.217 日本), 06/21/2026 23:37:00
FreeBSD 近期熱門文章
PTT數位生活區 即時熱門文章