ssh-agent – 这个过程有什么作用?

我在系统监视器中发现了一些奇怪的东西。 在我的进程列表中是’ssh-agent’,现在我对SSH不太熟悉,但我知道在VANILLA桌面Ubuntu安装上运行SSH服务是不正常的。 我跑了rkhunter,它没有特别回来。

我运行了这个命令,结果如下:

trev@trev-pc:~$ ps -aux | grep ssh trev 1635 0.0 0.0 11140 48 ? Ss Feb18 0:00 /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session /usr/bin/im-launch mate-session trev 15992 0.0 0.0 15192 2144 pts/1 S+ 20:06 0:00 grep --color=auto ssh 

这里发生了什么? 这是值得关注的吗?

不,这不是值得关注的事情。 这是ssh-agent ,而不是sshd ,它是SSH守护进程。 如果你看看man ssh-agent

  ssh-agent is a program to hold private keys used for public key authentication (RSA, DSA, ECDSA, ED25519). The idea is that ssh-agent is started in the beginning of an X-session or a login session, and all other windows or programs are started as clients to the ssh-agent program. 

它的工作方式是当你使用SSH连接到某个地方时(默认安装命令行客户端ssh ,而其他程序,如文件浏览器也可以作为SSH客户端),连接程序将使用代理来代替加载私钥本身:

  The agent will never send a private key over its request channel. Instead, operations that require a private key will be performed by the agent, and the result will be returned to the requester. This way, private keys are not exposed to clients using the agent. 

好处是您只需要在每个会话中解锁一次私钥(代理将其存储在内存中),并且客户端永远不会直接看到您未加密的私钥。

在某种程度上,它后门相反