-
Notifications
You must be signed in to change notification settings - Fork 0
/
openssh1.sh
37 lines (33 loc) · 1005 Bytes
/
openssh1.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
date=`date -d "0 day" +%Y%m%d`
rpm -e openssh-server
rpm -e openssh-clients
rpm -e openssh-askpass
rpm -e openssh
mv /etc/ssh /etc/ssh.bak
tar zxvf zlib-1.2.8.tar.gz
cd zlib-1.2.8
./configure --prefix=/usr/local/zlib && make && make install
cd ..
####install openssl########
tar zxvf openssl-1.0.2c.tar.gz
cd openssl-1.0.2c
./config --prefix=/usr/local/openssl && make && make install
cd ..
####install openssh########
tar -zxvf openssh-6.9p1.tar.gz
cd openssh-6.9p1
./configure --prefix=/usr/local/openssh --sysconfdir=/etc/ssh --with-ssl-dir=/usr/local/openssl --with-zlib=/usr/local/zlib --with-md5-passwords --without-hardening && make && make install
cd ..
mv /etc/init.d/sshd /etc/init.d/sshd.4.OFF.$date
cp sshd /etc/init.d/sshd
chmod +x /etc/init.d/sshd
mv /etc/init.d/sshd /etc/init.d/sshd.4.OFF.$date
cp ./contrib/redhat/sshd.init /etc/init.d/sshd
chmod +x /etc/init.d/sshd
chkconfig --add sshd
chkconfig sshd on
/etc/init.d/sshd restart
openssl version -a
ssh -V
exit