Environment: CentOS 7.1.1503 Minimum Installation Download dependency packages: yum -y install lrzsz zlib-devel perl gcc pam-devel 1. Install openssl and choose the latest released version: openssl-1.1.1g.tar.gz 1) OpenSSL download address: https://www.openssl.org/source/openssl-1.1.1g.tar.gz 2) Uninstall the system pre-installed openssl, this step can be omitted rpm -qa | grep openssl | grep -v lib yum -y remove openssl-1.0.1e-42.el7.x86_64 3) Installation steps: tar -zxvfopenssl-1.1.1g.tar.gz cdcd openssl-1.1.1g ./config --prefix=/usr/local/openssl --openssldir=/usr/local/openssl -Wl,-rpath,/usr/local/openssl/lib shared make && make install 4) Create a soft link ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl ln -s /usr/local/openssl/include/openssl /usr/include/openssl 5) Update system configuration echo "/usr/local/openssl/lib" >> /etc/ld.so.conf /sbin/ldconfig 6) Check the version openssl version 2. Install openssh, choose the latest released version: openssh-8.3p1.tar.gz 1) OpenSSH download address: https://openbsd.hk/pub/OpenBSD/OpenSSH/portable/openssh-8.3p1.tar.gz 2) Back up the system's openssh configuration file cp -r /etc/sysconfig/sshd /etc/sysconfig/sshd.bak cp -r /sys/fs/cgroup/systemd/system.slice/sshd.service /sys/fs/cgroup/systemd/system.slice/sshd.service.bak cp -r /usr/lib/systemd/system/sshd.service /usr/lib/systemd/system/sshd.service.bak cp -r /usr/lib/systemd/system/sshd.socket /usr/lib/systemd/system/sshd.socket.bak cp -r /usr/lib/systemd/system/[email protected] /usr/lib/systemd/system/[email protected] cp -r /usr/lib/systemd/system/sshd-keygen.service /usr/lib/systemd/system/sshd-keygen.service.bak 3) Uninstall the system pre-installed openssh, this step can be omitted rpm -qa | grep openssh yum -y remove openssh-server-6.6.1p1-11.el7.x86_64 openssh-clients-6.6.1p1-11.el7.x86_64 openssh-6.6.1p1-11.el7.x86_64 4) Back up the openssh configuration file. This step can be omitted. cp -r /etc/ssh /etc/ssh.bak rm -rf /etc/ssh #This step is very important and must be done 5) Installation steps tar -zxvf openssh-8.3p1.tar.gz cd openssh-8.3p1 ./configure --prefix=/usr/local/openssh --sysconfdir=/etc/ssh --with-openssl-includes=/usr/local/openssl/include --with-ssl-dir=/usr/local/openssl --with-zlib --with-md5-passwords --with-pam --with-ssl-engine make && make install 6) Create a soft link ln -s /usr/local/openssh/sbin/sshd /sbin/sshd ln -s /usr/local/openssh/bin/ssh /usr/bin/ssh ln -s /usr/local/openssh/bin/ssh-add /usr/bin/ssh-add ln -s /usr/local/openssh/bin/ssh-keygen /usr/bin/ssh-keygen ln -s /usr/local/openssh/bin/ssh-keyscan /usr/bin/ssh-keyscan 7) Restore the backed-up configuration file mv /etc/sysconfig/sshd.bak /etc/sysconfig/sshd mv /sys/fs/cgroup/systemd/system.slice/sshd.service.bak /sys/fs/cgroup/systemd/system.slice/sshd.service mv /usr/lib/systemd/system/sshd.service.bak /usr/lib/systemd/system/sshd.service mv /usr/lib/systemd/system/sshd.socket.bak /usr/lib/systemd/system/sshd.socket mv /usr/lib/systemd/system/[email protected] /usr/lib/systemd/system/[email protected] mv /usr/lib/systemd/system/sshd-keygen.service.bak /usr/lib/systemd/system/sshd-keygen.service 8) Check openssh version ssh -V 9) Modify the openssh configuration file to allow root login vi /etc/ssh/sshd_config Change #PermitRootLogin prohibit-password to PermitRootLogin yes 10) Set the sshd service to start at boot chkconfig sshd on 11) Restart the sshd service systemctl restart sshd && systemctl restart sshd && systemctl restart sshd && systemctl restart sshd & At this point, the openssh service installation is complete. If you are worried, you can reboot the machine ps: Let's see how to solve the problem of not generating dynamic link library .so when compiling and installing openssl under Linux The config command provided by the official website does not generate .so by default. The solution is to add the parameter shared when executing ./config, for example: ./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl -Wl,-rpath,/usr/local/ssl/lib shared Then make && make install Summarize This is the end of this article about how to install openssh from centos 7 source code. For more information about how to install openssh from centos 7 source code, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Detailed explanation of mandatory and implicit conversion of types in JavaScript
>>: When Navicat connects to MySQL, it reports 10060, 1045 errors and the location of my.ini
Table of contents MySQL's current_timestamp p...
This article example shares the specific code of ...
Introduction to Load Balancing Before introducing...
The skills that front-end developers need to mast...
1. Create a MySQL database 1. Create database syn...
Implement div wheel zooming in and out in Vue pro...
What are the attributes of the JS script tag: cha...
This article mainly introduces the case of Vue en...
Table of contents 1. Preparation 2. Introduction ...
I encountered several browser compatibility issue...
1. Check the character set of the database The ch...
1. Arrange CSS in alphabetical order Not in alphab...
The utf8mb4 encoding is a superset of the utf8 en...
Preview of revised version This article was writt...
/****************** * Linux kernel time managemen...