Linux openssh8.0p1升級步驟
準(zhǔn)備好gcc編譯庫括儒、pam-devel工具庫從鏡像文件rhel-server-6.8-x86_64-dvd.iso中獲取rpm安裝包;
mpfr-2.4.1-6.el6.x86_64.rpm
libmpcdec-1.2.6-6.1.el6.x86_64.rpm
kernel-headers-2.6.32-642.el6.x86_64.rpm
glibc-headers-2.12-1.192.el6.x86_64.rpm
glibc-devel-2.12-1.192.el6.x86_64.rpm
cpp-4.4.7-17.el6.x86_64.rpm
gcc-4.4.7-17.el6.x86_64.rpm
pam-devel-1.1.1-22.el6.x86_64.rpm
yum install -y mpfr libmpcdec kernel-headers glibc-headers glibc-devel cpp gcc pam-devel
備份 /etc/ssh 目錄
mv /etc/ssh /etc/ssh_bak
1飒房、安裝zlib
tar -xzvf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure --prefix=/usr/local/zlib-1.2.11
make && make install
2、安裝openssl
tar -xzvf openssl-1.1.0k.tar.gz
./config --prefix=/usr/local/openssl-1.1.0k
make && make install
echo "/usr/local/openssl-1.1.0k/lib" >> /etc/ld.so.conf
ldconfig
3、安裝openssh
tar -xzvf openssh-8.0p1.tar.gz
cd openssh-8.0p1/
./configure --prefix=/usr/local/openssh-8.0p1 --sysconfdir=/etc/ssh --with-ssl-dir=/usr/local/openssl-1.1.0k --with-zlib=/usr/local/zlib-1.2.11 --with-md5-passwords
make && make install
4废亭、配置openssh重啟腳本及變量
cd openssh-8.0p1/
cp -a contrib/redhat/sshd.init /etc/init.d/sshd
vi /etc/init.d/sshd
SSHD=/usr/local/openssh-8.0p1/sbin/sshd //25 SSHD=/usr/sbin/sshd
/usr/local/openssh-8.0p1/bin/ssh-keygen -A //41 /usr/bin/ssh-keygen -A
chkconfig --add sshd
chkconfig sshd on
chkconfig --list sshd
vi /etc/ssh/sshd_config //增加下一行
PermitRootLogin yes
vi /etc/profile 設(shè)置PATH變量
export PATH=/usr/local/openssh-8.0p1/sbin:/usr/local/openssh-8.0p1/bin:$PATH
source /etc/profile
service sshd restart