linux - 如何检查 Ubuntu 上是否安装了 openSSH

标签 linux openssh

如题所问,如何确定呢?仅仅能够在 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-clientopenssh-serveropenssh-sftp-serverssh-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

这是一个屏幕截图,您可以看到红色的 ssh 结果: enter image description here

另请注意,OpenSSH 由一大堆与 ssh 相关的二进制实用程序组成,而不仅仅是 ssh 命令。请参阅:https://en.wikipedia.org/wiki/OpenSSH .其中一些如下:

The OpenSSH suite includes the following command-line utilities and daemons:

  • scp, a replacement for rcp
  • sftp, a replacement for ftp to copy files between computers
  • ssh, a replacement for rlogin, rsh and telnet to allow shell access to a remote machine.
  • ssh-add and ssh-agent, utilities to ease authentication by holding keys ready and avoid the need to enter passphrases every time they are used
  • ssh-keygen, a tool to inspect and generate the RSA, DSA and Elliptic Curve keys that are used for user and host authentication
  • ssh-keyscan, which scans a list of hosts and collects their public keys
  • sshd, the SSH server daemon

引用资料:

  1. https://en.wikipedia.org/wiki/OpenSSH
  2. https://askubuntu.com/questions/423355/how-do-i-check-if-a-package-is-installed-on-my-server

关于linux - 如何检查 Ubuntu 上是否安装了 openSSH,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47079224/

相关文章:

git - 无法将 git repo 推送到 Digital Ocean 液滴上的 Dokku 远程?

java - 如何从 C 程序运行 Java 程序?

ubuntu - svn : E170013: Unable to connect to a repository at URL

ssh - 使用 SSH key 连接到远程 Centos 服务器

linux - 备份 MySQL 数据库的 Bash 脚本

perl - Net::OpenSSH 中的交互模式

ssh - 如何验证潜在的公共(public) ssh key 部分?

c++ - 在 C++ 中使用 system() 时,我的程序卡住了,我该如何让它继续?

linux - 从文件中打印 IFS 值

linux - 如何在 linux 上获取正在运行的线程的起始地址?