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守护进程,如果我运行版本命令,它返回一个非零的退出状态,因为未知的选项。
$ rpm -qf /usr/sbin/sshd
当我查看rpm包并grep查找ssh时,我得到了以下结果,但我如何通过编程知道ssh来自包openssh?[root@vm ~]# rpm -qa