6

I try to install OpenSSH

./configure
checking for openssl/opensslv.h... no
configure: error: *** OpenSSL headers missing

any idea?

1
  • As jamespo points out, are you sure you want to build it from source? Openssh is quite a critical attack vector if any exploits should be found, so it would be best to use the repositories so you get security updates.
    – Egil
    Apr 6, 2011 at 9:50

4 Answers 4

7

I would install the openssh server package if you have a choice apt-get install openssh-server. However if you want to compile from source install openssl first.

Either from source or from the package: apt-get install libssl-dev openssl

2

To install dependencies needed to build a given package, you can use apt-get's build-dep option, e.g., apt-get build-dep openssh or apt-get build-dep openssh-server if you are trying to build the server.

2

tl;dr download, unpack, configure, build, install

basic build + install steps

Using version 9.0p1 as an example:

wget https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.0p1.tar.gz
tar -xvf openssh-9.0p1.tar.gz
cd openssh-9.0p1
./configure
make
make install

portable release

Make sure to download the Portable Release source code (unless running OpenBSD OS).

gpg verify

Optionally, verify the download before the tar command:

wget https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/RELEASE_KEY.asc
gpg --import RELEASE_KEY.asc
wget https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.0p1.tar.gz.asc
gpg --verbose --verify openssh-9.0p1.tar.gz.asc

build dependencies

If there is a missing header or library during the ./configure command, you can view the dependencies for the built-in OpenSSH using apt

apt show openssh-server

The packages listed under Depends: will most likely be adequate for building the downloaded OpenSSH .tar. Install the needed dependencies for building using apt install.

A few extra packages I installed on my Debian 10 system:

apt install \
  libssl-dev \
  gcc g++ gdb cpp \
  make cmake \
  libtool \
  libc6 \
  autoconf automake pkg-config \
  build-essential \
  gettext


I wrote a full step-by-step write-up for installing the latest OpenSSH.

1

It's likely you are missing the development headers for openssl. Try installing "openssl-devel".

1
  • @tijybba Can you remove your duplicate comment?
    – nanofarad
    Sep 16, 2012 at 12:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .