6
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

OpenSSHをインストール(ソースからコンパイル)する for CentOS7.3

Last updated at Posted at 2016-09-19

##概要
今時、OpenSSHはOSの標準パッケージとしてインストールされていますが、あえてソースからコンパイルする方法をメモしています。
2017年5月現在の最新版は、7.5.1p1です。
CentOS以外にもRHELでも同様の方法で適用可能です。

##ダウンロード先
OpenSSH公式サイト:
http://www.openssh.com/

OpenSSHミラーサイトダウンロード先:
http://ftp.jaist.ac.jp/pub/OpenBSD/OpenSSH/portable/

##前提
あらかじめOpenSSLがインストールされている必要があります。
OpenSSLのインストールはOpenSSL(1.0.x)をインストールする(ソースからコンパイル)for CentOS 7.2を参照してください。

実践環境バージョン情報

ソフトウェア バージョン
OpenSSH 7.5p1
OS CentOS 7.3

##事前準備
ld.so.confに、/usr/local/sslの参照を追加しておく

##インストール

インストール&コンパイル
#あらかじめキーファイルの権限を変更
chmod 600 /etc/ssh/ssh_host_*

#ソースをダウンロードしてコンパイル
cd /usr/local/src
wget http://ftp.jaist.ac.jp/pub/OpenBSD/OpenSSH/portable/openssh-7.5p1.tar.gz
tar xvzf openssh-7.5p1.tar.gz
cd openssh-7.5p1
./configure \
--with-zlib=/usr/local \
--with-tcp-wrappers \
--with-ssl-dir=/usr/local/ssl \
--with-ssl-engine \
--with-pam \
--with-md5-passwords \
--bindir=/usr/bin \
--sbindir=/usr/sbin \
--libexecdir=/usr/libexec \
--sysconfdir=/etc/ssh 
make
make install

failed to map segment from shared object: Permission denied
とメッセージが出る場合は、SELinuxが有効になっていますので、SELinuxを無効にして試す必要があります。

##GSSAPIの設定変更
sshd_configのGSSAPI設定を無効にします

/etc/ssh/sshd_config
vi /etc/ssh/sshd_config
GSSAPIAuthentication yes
GSSAPICleanupCredentials no
↓
#GSSAPIAuthentication yes
#GSSAPICleanupCredentials no

これで、設定完了。
サービスの再起動を行う。

systemctl restart sshd

バージョンの確認を行う

sshd -V
結果
unknown option -- V
OpenSSH_7.5p1, OpenSSL 1.0.2k  26 Jan 2017

OpenSSH_7.5p1と出ていればOKです。

6
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?