Created
October 6, 2016 14:02
-
-
Save faishal/add912b9b4c3899ec26c488a91446a84 to your computer and use it in GitHub Desktop.
Upgrade OpenSSH to 7.3p1 in Cent OS 6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Copyright © 2016 Faishal Saiyed | |
cd | |
timestamp=$(date +%s) | |
if [ ! -f openssh-7.3.zip ]; then wget https://github.com/faishal/openssh-portable/releases/download/cent.os.6.7.openssh.7.3p1/openssh-7.3.zip; fi; | |
unzip -o openssh-7.3.zip -d openssh-7.3p1 | |
cd openssh-7.3p1/ | |
cp /etc/pam.d/sshd pam-ssh-conf-$timestamp | |
rpm -U *.rpm | |
yes | cp pam-ssh-conf-$timestamp /etc/pam.d/sshd | |
/etc/init.d/sshd restart |
Not suggesting anything here, but I would be cautions install openssh from anything that is not the formal openssh mirrors.
Avner,
That is a well-taken caution - thx for the reminder!
Hi faishal, I changed this script into ansible. when rpm -U *.rpm
my machine went unreachable. I can't go to the machine. Can you help me out?
Do not follow @sivasshankar4s script I made a test and it changes my root password... Dude trying to hack with his work luckily I made this on a test VM.
Do not follow @sivasshankar4s script I made a test and it changes my root password... Dude trying to hack with his work luckily I made this on a test VM.
Thanks for reporting this.
Hi Faishal, I need 7.4p1 for Centos 6.10. Can you please help?
awesome script! thanks a lot!!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
FYI I just tried with CENTOS 6.9, and it has a problem with the dependency:
./upgrade-openssh.sh Archive: openssh-7.3.zip inflating: openssh-7.3p1/openssh-7.3p1-1.x86_64.rpm inflating: openssh-7.3p1/__MACOSX/._openssh-7.3p1-1.x86_64.rpm inflating: openssh-7.3p1/openssh-clients-7.3p1-1.x86_64.rpm inflating: openssh-7.3p1/__MACOSX/._openssh-clients-7.3p1-1.x86_64.rpm inflating: openssh-7.3p1/openssh-debuginfo-7.3p1-1.x86_64.rpm inflating: openssh-7.3p1/__MACOSX/._openssh-debuginfo-7.3p1-1.x86_64.rpm inflating: openssh-7.3p1/openssh-server-7.3p1-1.x86_64.rpm inflating: openssh-7.3p1/__MACOSX/._openssh-server-7.3p1-1.x86_64.rpm error: Failed dependencies: openssh = 5.3p1-123.el6_9 is needed by (installed) openssh-askpass-5.3p1-123.el6_9.x86_64 Stopping sshd: [ OK ] Starting sshd: [ OK ]
The thing I don't understand is that there appears to be the correct openssh already installed, so why is that dependency failing?
rpm -qa | grep openssh openssh-clients-5.3p1-123.el6_9.x86_64 openssh-askpass-5.3p1-123.el6_9.x86_64 openssh-5.3p1-123.el6_9.x86_64 openssh-server-5.3p1-123.el6_9.x86_64
Thanks,
Jim