以程序方式查找给定的软件包和版本。

问题描述 投票:0回答:1

grep ssh openssh-clients-7.4p1-21....

[root@vm ~]# rpm -qa | grep ssh
openssh-clients-7.4p1-21.el7.x86_64
libssh2-1.8.0-3.el7.x86_64
sshpass-1.06-2.el7.x86_64
openssh-7.4p1-21.el7.x86_64
openssh-server-7.4p1-21.el7.x86_64

If you have the path:

[root@vm ~]# ssh -V
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017

If you have the $PID:V

[root@vm ~]# sshd -V
unknown option -- V
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017
usage: sshd [-46DdeiqTt] [-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]

如果运行下面的命令,我看到它是OpenSSH。

但是对于ssh守护进程,如果我运行版本命令,它返回一个非零的退出状态,因为未知的选项。
linux centos rpm
1个回答
0
投票

$ rpm -qf /usr/sbin/sshd

当我查看rpm包并grep查找ssh时,我得到了以下结果,但我如何通过编程知道ssh来自包openssh?[root@vm ~]# rpm -qa

© www.soinside.com 2019 - 2024. All rights reserved.