I have a server running Ubuntu 14.04, but I have an issue with PCI requirements. I have installed in my server OpenSSH 6.6p1, then I upgraded it to OpenSSH 7.2p, compiling the c
This is an edit from @dszakal's comment since I did not have exactly the same things to do (Ubuntu 16 here).
cd
wget http://mirror.exonetric.net/pub/OpenBSD/OpenSSH/portable/openssh-7.7p1.tar.gz
tar -zxvf openssh-7.7p1.tar.gz
cd openssh-7.7p1
wget http://www.linuxfromscratch.org/patches/blfs/svn/openssh-7.7p1-openssl-1.1.0-1.patch
patch -Np1 -i ./openssh-7.7p1-openssl-1.1.0-1.patch
./configure --prefix=/opt
make
sudo make install
cp ~/openssh-7.7p1/sshd_config /opt/etc/
cp ~/openssh-7.7p1/ssh_config /opt/etc/
sudo nano /opt/etc/sshd_config
# Uncomment the lines I wrote below
---------------------------------------------
Port 33333 # You can change the port here
AddressFamily any
ListenAddress 0.0.0.0
ListenAddress ::
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
PasswordAuthentication yes
PermitEmptyPasswords no
---------------------------------------------
# Then launch the service
sudo /opt/sbin/sshd
Then try to log in with your usual credentials, it should work.
Nmap report :
PORT STATE SERVICE VERSION
33333/tcp open ssh OpenSSH 7.7 (protocol 2.0)
Now we will transfer the new SSH to port 22. I logged in on port 33333 to disabled the old SSH service & changed 33333 to 22 in /opt/etc/sshd_config
sudo service ssh stop
sudo nano /opt/etc/sshd_config
Port 22
# Then re-launch the service
sudo /opt/sbin/sshd
Then try to log in with your usual credentials, it should work.
Nmap report :
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 7.7 (protocol 2.0)
Works like a charm big thanks to @dszakal !!