Install openssh to redhat 6.3 via source

This post is the log for compile source and install some package to linux, yeah, it’ll fit to offline install while you’re download packages before.

Download

Install via source

  1. Install requirements
yum install -y zlib-devel pam-devel tcp_wrappers-devel

OR install via source, such as zlib:

tar zxf zlib-1.2.11.tar.gz
cd zlib-1.2.11.tar.gz
./configure
make
make install
  1. Install openssl-fip

Refer: http://www.openssl.org/docs/fips

tar zxf openssl-fips-2.0.16.tar.gz
cd openssl-fips-2.0.16
./config
make
make install
  1. Install openssl
tar zxf openssl-OpenSSL_1_0_2u.tar.gz
cd openssl-OpenSSL_1_0_2u
./config fips --shared
make
make install

openssl succeeded install printing:

OpenSSL shared libraries have been installed in:
/usr/local/ssl

If this directory is not in a standard system path for dynamic/shared
libraries, then you will have problems linking and executing
applications that use OpenSSL libraries UNLESS:

* you link with static (archive) libraries. If you are truly
paranoid about security, you should use static libraries.
* you use the GNU libtool code during linking
(http://www.gnu.org/software/libtool/libtool.html)
* you use pkg-config during linking (this requires that
PKG_CONFIG_PATH includes the path to the OpenSSL shared
library directory), and make use of -R or -rpath.
(http://www.freedesktop.org/software/pkgconfig/)
* you specify the system-wide link path via a command such
as crle(1) on Solaris systems.
* you add the OpenSSL shared library directory to /etc/ld.so.conf
and run ldconfig(8) on Linux systems.
* you define the LD_LIBRARY_PATH, LIBPATH, SHLIB_PATH (HP),
DYLD_LIBRARY_PATH (MacOS X) or PATH (Cygwin and DJGPP)
environment variable and add the OpenSSL shared library
directory to it.

One common tool to check the dynamic dependencies of an executable
or dynamic library is ldd(1) on most UNIX systems.

See any operating system documentation and manpages about shared
libraries for your version of UNIX. The following manpages may be
helpful: ld(1), ld.so(1), ld.so.1(1) [Solaris], dld.sl(1) [HP],
ldd(1), crle(1) [Solaris], pldd(1) [Solaris], ldconfig(8) [Linux],
chatr(1) [HP].
cp libcrypto.pc /usr/local/ssl/lib/pkgconfig
chmod 644 /usr/local/ssl/lib/pkgconfig/libcrypto.pc
cp libssl.pc /usr/local/ssl/lib/pkgconfig
chmod 644 /usr/local/ssl/lib/pkgconfig/libssl.pc
cp openssl.pc /usr/local/ssl/lib/pkgconfig
chmod 644 /usr/local/ssl/lib/pkgconfig/openssl.pc
  1. Link openssl library to system libs, if step3, openssl config contains --prefix=/usr, skip below.
echo "/usr/local/ssl/lib" >> /etc/ld.so.conf
ldconfig
  1. Install openssh
tar zxf openssh
cd openssh
./configure --prefix=/usr/local/ssh --sysconfdir=/etc/ssh --with-ssl-dir=/usr/local/ --with-sandbox=n
make
make install

*. If error occur as 系统没有找到openssl库 , you need execute the command: ldconfig.

My Succeeded Install log

## 1. Download packages.

## 2. Install requirements

yum install -y zlib-devel pam-devel tcp_wrappers-devel

# OR install zlib via source

tar zxf zlib-1.2.11.tar.gz
cd zlib-1.2.11.tar.gz
./configure
make
make install

## 3. Install openssl-fip

http://www.openssl.org/docs/fips

tar zxf openssl-fips-2.0.16.tar.gz
cd openssl-fips-2.0.16
./config
make
make install

## 4.Install openssl

tar zxf openssl-OpenSSL_1_0_2u.tar.gz
cd openssl-OpenSSL_1_0_2u
./config fips --shared
make
make install

---------------------------- install printing ----------------------------
OpenSSL shared libraries have been installed in:
/usr/local/ssl

If this directory is not in a standard system path for dynamic/shared
libraries, then you will have problems linking and executing
applications that use OpenSSL libraries UNLESS:

* you link with static (archive) libraries. If you are truly
paranoid about security, you should use static libraries.
* you use the GNU libtool code during linking
(http://www.gnu.org/software/libtool/libtool.html)
* you use pkg-config during linking (this requires that
PKG_CONFIG_PATH includes the path to the OpenSSL shared
library directory), and make use of -R or -rpath.
(http://www.freedesktop.org/software/pkgconfig/)
* you specify the system-wide link path via a command such
as crle(1) on Solaris systems.
* you add the OpenSSL shared library directory to /etc/ld.so.conf
and run ldconfig(8) on Linux systems.
* you define the LD_LIBRARY_PATH, LIBPATH, SHLIB_PATH (HP),
DYLD_LIBRARY_PATH (MacOS X) or PATH (Cygwin and DJGPP)
environment variable and add the OpenSSL shared library
directory to it.

One common tool to check the dynamic dependencies of an executable
or dynamic library is ldd(1) on most UNIX systems.

See any operating system documentation and manpages about shared
libraries for your version of UNIX. The following manpages may be
helpful: ld(1), ld.so(1), ld.so.1(1) [Solaris], dld.sl(1) [HP],
ldd(1), crle(1) [Solaris], pldd(1) [Solaris], ldconfig(8) [Linux],
chatr(1) [HP].
cp libcrypto.pc /usr/local/ssl/lib/pkgconfig
chmod 644 /usr/local/ssl/lib/pkgconfig/libcrypto.pc
cp libssl.pc /usr/local/ssl/lib/pkgconfig
chmod 644 /usr/local/ssl/lib/pkgconfig/libssl.pc
cp openssl.pc /usr/local/ssl/lib/pkgconfig
chmod 644 /usr/local/ssl/lib/pkgconfig/openssl.pc
---------------------------- install printing end ----------------------------

## 5. 将新编译的openssl library 加入系统动态库链接中, 如果在第4步openssl 编译过程中,将其设定为OS默认安装目录(--prefix=/usr),那么此步骤无需执行!

echo "/usr/local/ssl/lib" >> /etc/ld.so.conf
ldconfig

## 6. Install openssh

tar zxf openssh
cd openssh
./configure --prefix=/usr/local/ssh --sysconfdir=/etc/ssh --with-ssl-dir=/usr/local/ --with-sandbox=n
make
make install

### If error occur as `系统没有找到openssl库` means command need: `ldconfig`.

EOF

0%