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

ctr*_*rev 2 ssh

我在系统监视器中发现了一些奇怪的东西。在我的进程列表中是“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
Run Code Online (Sandbox Code Playgroud)

这里发生了什么?这是需要担心的事情吗?

mur*_*uru 17

不,这不是值得关注的事情。这是SSH 守护进程,而ssh-agent不是sshd。如果你看看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.
Run Code Online (Sandbox Code Playgroud)

它的工作原理是,当你使用 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.
Run Code Online (Sandbox Code Playgroud)

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

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