0

So I have a web server that is running 14.04LTS because that is the latest Ubuntu Distribution I can have through my VPS. I have been trying to install OpenSSH 7.2p2 via building the source code via the following commands:

wget http://mirrors.sonic.net/pub/OpenBSD/OpenSSH/portable/openssh-7.2p2.tar.gz
tar -zxvf openssh-7.2p2.tar.gz
cd openssh-7.2p2
./configure
sudo make
sudo make install

And when I type ssh -V I get the output: OpenSSH_7.2p2, OpenSSL 1.0.2h 3 May 2016, but when I try service ssh I get ssh: unrecognized service. Any ideas what I'm missing?

0

You installed the openssh binaries, but not its Upstart service (the glue connecting ubuntu and openssh service).

You also probably installed the files with different paths than used in Ubuntu so getting service file (/etc/init.d/ssh) from Ubuntu wont solve the problem completely (but can give you some guide).

Regardless what makes you install openssh from source, it is almost never a good idea and you would better be with updating your Ubuntu to latest 16.04.

  • If I had that option I would, believe me, but my VPS has not made 16.04LTS available yet, and because of their setup (using OpenVZ I believe) upgrading using the console upgrade manager breaks everything (from what I could tell, I think it was a combination of incompatible kernel, which I can't upgrade even through sudo apt-get dist-upgrade, and something going wrong with the startup services). For the time being, my options are limited to installing openssh from the source, or finding a PPA with an updated openssh build which I could not find. – Nick Welna Jun 27 '16 at 16:11
0

So with the info Jakuje provided I figured out the solution. This should only be used if you DO NOT have the option to upgrade to a newer LTS version, but need to upgrade OpenSSH and cannot find a ppa with the build you need.

First install openssh-server via sudo apt-get install openssh-server. After that is installed, copy /etc/init/ssh.conf and /etc/init.d/ssh to somewhere safe. Now uninstall openssh-server and openssh-client (which openssh-server installed) via sudo apt-get remove --purge openssh-server and sudo apt-get remove --purge openssh-client. If you plan to use privilege serpartaion follow the instructions here: https://github.com/openssh/openssh-portable/blob/master/README.privsep. Now do the following:

wget http://mirrors.sonic.net/pub/OpenBSD/OpenSSH/portable/openssh-7.2p2.tar.gz
tar -zxvf openssh-7.2p2.tar.gz
cd openssh-7.2p2
./configure --prefix=/usr --sysconfdir=/etc/ssh
sudo make
sudo make install

After this, place the files you copied earlier back where you found them. When you restart your system, the service should be recognized and automatically start!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.