V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
shelken
V2EX  ›  问与答

为什么 sshd 服务没有启动?但是可以访问?

  •  
  •   shelken · Mar 26, 2023 · 1713 views
    This topic created in 1128 days ago, the information mentioned may be changed or developed.

    本人在 pve 上起了个容器,然后设置的时候把自己 mac mini 公钥填入,因此我从 mini ssh 过去可以直接连接,其他机器不能。然后我在容器里执行:systemctl status sshd 却发现 ssh.service 没有启动:

    ○ ssh.service - OpenBSD Secure Shell server
         Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
         Active: inactive (dead)
           Docs: man:sshd(8)
                 man:sshd_config(5)
    

    请问下这样正常吗?不太理解为什么 ssh 服务没启动,我的 mini 也能连上 求大佬解释下

    5 replies    2023-03-27 13:35:30 +08:00
    Firxiao
        1
    Firxiao  
       Mar 26, 2023 via iPhone
    容器里面没有 systemd 服务
    可以用 ps 检查下进程
    shelken
        2
    shelken  
    OP
       Mar 26, 2023
    @Firxiao
    好像有运行起来?难道 sshd 默认不是由 systemd 运行的吗?

    ```
    ➜ ~ ps aux | grep ssh
    root 6384 0.0 0.0 17192 10940 ? Ss 06:12 0:00 sshd: root@pts/3
    ```
    mingwiki
        3
    mingwiki  
       Mar 26, 2023
    进程死了不代表不工作 解决办法是重启
    hyperbin
        4
    hyperbin  
       Mar 27, 2023 via Android
    systemd 只能监控制自己拉起来的服务器
    julyclyde
        5
    julyclyde  
       Mar 27, 2023
    @shelken “默认”这个词对你没啥用
    你现在遇到的就是非默认的情况
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1291 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 23:40 · PVG 07:40 · LAX 16:40 · JFK 19:40
    ♥ Do have faith in what you're doing.