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.
- How to configure an Open Suse Linux Server
- Comprehensive Analysis of Suse Linux passed the sun Test
- Preschool guidance: SUSE Linux
- Follow the summer project of Open Suse and Google Programming
- Describe how to install Jdk and mysql in Open SUSE