Brief Analysis of OpenSSH source code compilation and upgrade on Linux Server

Source: Internet
Author: User
Tags openssl version ssh port

Linux has now become the mainstream, and many people are using the Linux system, from which we also find many problems. Today we mainly talk about OpenSSH source code compilation and upgrade on Linux servers, I hope you can learn about Linux server issues.

1. We recommend that you use the source code Installation Method to download the installation package.
Cd/root
Wget-c "ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-5.0p1.tar.gz"
Tarzxvfopenssh-5.0p1.tar.gz
Cdopenssh-5.0p1

2. Confirm the Zlib and OpenSSL versions for the upgrade:

Openssh-5.0p1 requires Zlib version above 1.2.1.2 and OpenSSL version above 0.9.6. The official addresses of Zlib and OpenSSL are as follows:
Http://www.gzip.org/zlib/
Http://www.openssl.org/

Note: OpenSSL0.9.5a is an acceptable version. However, when using SSHprotocol1, some encryption functions may have problems. For security reasons, we recommend SSHprotocol2 ). For details, see the INSTALL document.

3. compile common parameters -- prefix = and -- sysconfdir =. If the preceding parameters are omitted, the default ssh will be installed under/usr/local/bin, and sshd will be installed in/usr/local/sbin, sftp-server is installed in/usr/local/libexec/sftp-server, and the configuration file is in/usr/locale/etc.
/Configure -- sysconfdir =/etc/ssh
Make
Makeinstall

4. Compare and install the default and current configuration files. Make sure to modify some important parameters.
Diffsshd_config/etc/ssh. bak/sshd_config

5. Recommended Configuration File Settings

Check whether the/usr/local/libexec/sftp-server path is correct.

6. Check the correctness of the configuration file
Grep-v ^ #/etc/ssh/sshd_config | awk '{print $1}' | sort | uniq-d

Duplicate rows?
/Usr/local/sbin/sshd-t

The parameter is correct

7. Add the/etc/init. d script and service

Back up the original script cp/etc/init. d/sshd/etc/init. d/sshd. bak

Modify the ssh-keygen and sshd paths. The PID file is also modified to avoid conflicts with the previous sshd, so that the new sshd service can be configured without affecting the original sshd. Modify the following three items:

Originally:

KEYGEN =/usr/bin/ssh-keygen
SSHD =/usr/sbin/sshd
PID_FILE =/var/run/sshd. pid

Changed:

KEYGEN =/usr/local/bin/ssh-keygen
SSHD =/usr/local/sbin/sshd
PID_FILE =/var/run/sshd2.pid

Add service:
/Sbin/chkconfig -- addsshd

8. Restart the sshd service

Note: Before starting the new sshd service, temporarily modify the port in sshd_config to avoid conflict with the original ssh port.
/Sbin/servicesshdstart

This article describes how to compile and Upgrade OpenSSH source code on Linux servers.

  1. How to configure an Open Suse Linux Server
  2. Comprehensive Analysis of Suse Linux passed the sun Test
  3. Preschool guidance: SUSE Linux
  4. Follow the summer project of Open Suse and Google Programming
  5. Describe how to install Jdk and mysql in Open SUSE

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.