如题所问,如何确定呢?仅仅能够在 Linux 机器上使用 ssh 是否意味着安装了 openSSH?我尝试了 ssh -V
并且它给了我一个版本号,但这是否意味着 openSSH 已安装或者 ssh 命令来自另一个工具?
最佳答案
当我执行 ssh -V
检查版本时,我得到以下信息,表明我确实安装了 openssh:
$ ssh -V
OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.13, OpenSSL 1.0.1f 6 Jan 2014
如果你没有看到 OpenSSH
加上版本号,就像我一样,那么你一定没有安装 openssh-client
,正如你暗示的那样,你必须从其他一些 ssh 应用程序获取 ssh
二进制文件。
要查看安装的所有包含 ssh
的软件包,请使用以下命令将 dpkg --list
输出通过管道传输到 grep
:
dpkg --list | grep ssh
...正如我在下面所做的那样。你可以看到我有 openssh-client
、openssh-server
、openssh-sftp-server
和 ssh-add
安装,所有这些都是 OpenSSH 的一部分:
$ dpkg --list | grep ssh
ii libssh-4:amd64 0.6.1-0ubuntu3.3 amd64 tiny C SSH library
ii libssh2-1:amd64 1.4.3-2ubuntu0.1 amd64 SSH2 client-side library
ii openssh-client 1:6.6p1-2ubuntu2.13 amd64 secure shell (SSH) client, for secure access to remote machines
ii openssh-server 1:6.6p1-2ubuntu2.13 amd64 secure shell (SSH) server, for secure access from remote machines
ii openssh-sftp-server 1:6.6p1-2ubuntu2.13 amd64 secure shell (SSH) sftp server module, for SFTP access from remote machines
ii python-paramiko 1.10.1-1git1build1 all Make ssh v2 connections with Python (Python 2)
ii ssh-askpass-gnome 1:6.6p1-2ubuntu2.8 amd64 interactive X program to prompt users for a passphrase for ssh-add
ii ssh-import-id 3.21-0ubuntu1 all securely retrieve an SSH public key and install it locally
ii sshfs 2.5-1ubuntu1 amd64 filesystem client based on SSH File Transfer Protocol
ii sshpass 1.05-1 amd64 Non-interactive ssh password authentication
另请注意,OpenSSH 由一大堆与 ssh 相关的二进制实用程序组成,而不仅仅是 ssh
命令。请参阅:https://en.wikipedia.org/wiki/OpenSSH .其中一些如下:
The OpenSSH suite includes the following command-line utilities and daemons:
scp
, a replacement forrcp
sftp
, a replacement forftp
to copy files between computersssh
, a replacement forrlogin
,rsh
andtelnet
to allow shell access to a remote machine.ssh-add
andssh-agent
, utilities to ease authentication by holding keys ready and avoid the need to enter passphrases every time they are usedssh-keygen
, a tool to inspect and generate the RSA, DSA and Elliptic Curve keys that are used for user and host authenticationssh-keyscan
, which scans a list of hosts and collects their public keyssshd
, the SSH server daemon
引用资料:
关于linux - 如何检查 Ubuntu 上是否安装了 openSSH,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47079224/