Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to upgrade openssh under Linux

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "how to upgrade openssh under Linux". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Download openssh

Connect to the target host directly through ssh to download (it is recommended to download the package to the / opt directory):

[root@sd-vm-0001252 opt] # wget wget https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-7.8p1.tar.gz

If the instruction prompts command not found after executing wget, it is because the wget directive is not installed on the target machine

Wget instruction installation

Yum-y install wget

Tips for successful installation:

Or download the openssh directly on the windows and upload it to the target host: after the download is complete, decompress the tar-xvf openssh-7.8p1.tar.gz package

After decompression, get the compressed package:

Third, delete the original ssh-related files first uninstall the openssh service, pay attention! Be careful! Be careful! The ssh service will be stopped after uninstalling the server. At this time, the client connection cannot be disconnected, and the ssh service and server cannot be restarted before the ssh is installed. Otherwise, it will not be possible to remotely connect yum remove openssh-y and manually delete the original ssh related files rm-rf / etc/ssh/*. 4. Install and compile the new ssh to enter the unzipped ssh directory (according to your actual situation). The directory extracted by each person may be different. Here the extracted directory is / opt/openssh-7.8p1/): cd / opt/openssh-7.8p1/ installation and compilation:. / configure-- prefix=/usr/-- sysconfdir=/etc/ssh-- with-openssl-includes=/usr/local/ssl/include-- with-ssl-dir=/usr/local/ssl-- with-zlib-- with-md5-passwords-- with-pam & & make & & make install

Note: if the compilation process is interrupted during installation and prompted by configure: error: PAM headers not found, you need to install PAM manually first.

Install PAM manually:

Yum-y install pam-devel

The installation is complete with PAM:

The Openssh installation completion icon:

After the Openssh installation is complete, execute the following command in the / openssh-7.8p1 directory:

[root@sd-vm-0001252 openssh-7.8p1] cp-a contrib/redhat/sshd.init / etc/init.d/sshd [root@sd-vm-0001252 openssh-7.8p1] cp-a contrib/redhat/sshd.pam / etc/pam.d/sshd.pam [root@sd-vm-0001252 openssh-7.8p1] chmod + x / etc/init.d/sshd [root@sd-vm-0001252 openssh-7.8p1] chkconfig-- add sshd [root@sd-vm-0001252 openssh-7 .8p1] chkconfig sshd on [root@sd-vm-0001252 openssh-7.8p1] service sshd restart 5. View Openssh version ssh-V

VI. The problem cannot be solved remotely after openSSH upgrade

Enter the directory / etc/ssh/sshd_config to open the PasswordAuthentication yes comment and enable public key authentication

The vi / etc/ssh/sshd_config icon:

Then restart the ssh service:

Service sshd restart

Or

/ etc/init.d/sshd restart 7. Root (default account) cannot solve remote login problem (Access denied) after openSSH upgrade.

Root (default account) generally does not allow remote password login access (high-risk vulnerabilities will occur during security scanning during testing), so it is prohibited by default, and can be manually enabled if necessary (not recommended). It is recommended that if you need to use root users, you can connect to the server with an ordinary account, and then switch to root users by su command.

Specific operation steps:

Modify the SSH service configuration file sshd_config to resolve this problem. The file path is: / etc/ssh/sshd_config

Vi / etc/ssh/sshd_config diagram: "how to upgrade openssh under Linux" is introduced here. Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report