Check OpenSSH version and update instructions on FreeBSD system

Solution 1:

Run sshd -V or ssh -V and they'll return the version and usage information.
Note: These are capital "V" now, when I originally wrote this answer they were lower case.

There's a dozen ways to upgrade.

  • pkg-add -r openssh-portable
  • cd /usr/ports/security/openssh && make install clean
  • portupgrade security/openssh-portable
  • part of the makeworld/buildworld process
  • freebsd-upgrade
  • and the list goes on...

I'm not aware of any issues with the 5.2p1 version that shipped with 8.1-RELEASE. I have seen hoax e-mails flying around for over a year now announcing the imminent release of a zero day hack (note that it's been a year and a half since release, so 'zero' day was a heck of a long time ago).

Solution 2:

telnet localhost 22

Why do you want to upgrade OpenSSH? It's part of the core system and is usually upgraded with the system.


Solution 3:

Try running:

which sshd

If that prints /usr/sbin/sshd, then it's probably installed as a package. In that case, you can check the installed version using:

pkg_info | grep ssh

or:

pkg_info -W `type sshd`

And I think you update it using:

pkg_add -r openssh-portable

but read the FreeBSD Guide to the Packages System first, because I haven't done that in a long time and it might have changed.

If

which sshd

prints /usr/local/sbin/sshd, then it's probably installed as a port.

Read up on how to upgrade it in the Guide to Using the Ports System. The port name is security/openssh-portable, i.e. /usr/ports/security/openssh-portable.


Solution 4:

How to find openssh version on a Linux or Unix-like system?

The syntax is as follows to find openssh version on a CentOS/RHEL/SL:

# yum list installed openssh\*

The syntax is as follows to find openssh version on a Debian/Ubuntu Linux:

$ dpkg --list | grep openssh
### OR ###
$ dpkg --list openssh\*

Sample output

Tags:

Ssh

Freebsd