有没有办法运行sshd
以便它可以(至少对于有限数量的登录)成功返回提示(可能是 busybox),即使 fork 不可用(例如,PID 不足)?
在我看来,这应该是可能的,例如,sshd 预 fork 并保留一个池 getty
s 用于服务登录请求。
最佳答案
SSHD 可以通过 -D
启动或 -d
选项。
-D:
When this option is specified, sshd will not detach and does not become a daemon.
This allows easy monitoring of sshd.
-d:
Debug mode.
The server sends verbose debug output to standard error, and does not put itself in the background.
The server also will not fork and will only process one connection. This option is only intended for debugging for the server.
Multiple -d options increase the debugging level. Maximum is 3.
我想你最好的选择是运行一个单独的
SSHD
进程,监听另一个端口,使用 -d
选项。因此,当“普通”SSHD 出现故障时,您仍然可以使用备用端口切换到另一个。
关于login - 叉 "free"sshd?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8406987/