LoginSignup
1
1

Ubuntuのopensshを9.6.1pにアップデート

Last updated at Posted at 2024-01-20

opensslの脆弱性対応で9.6.1にアップデートしたのでメモ

環境

仮想化:VMware Workstation-playre17またはVMware workstation-pro17
ホスト:Windows10またはWindows11pro
ゲスト:ubuntu22.04.3TLS

環境構築時のメモ
VMでWindowsホストにUbuntuをゲスト起動する
dockerコンテナ環境作成

アップデート手順

現状のsshのバージョン確認
ssh -V
パッケージリストを更新
sudo apt-get install aptitude
aptitudeのインストール
sudo apt-get install aptitude
必要なパッケージのインストール
sudo aptitude install build-essential zlib1g-dev libssl-dev libpam0g-dev libselinux1-dev libkrb5-dev
ディレクトリ作成と設定
sudo mkdir /var/lib/sshd && sudo chmod -R 700 /var/lib/sshd/ && sudo chown -R root:sys /var/lib/sshd/
作業用ディレクトリ移動
cd ~/Downloads/

任意のディレクトリを指定

ソースのダウンロードと展開
wget -c http://mirror.exonetric.net/pub/OpenBSD/OpenSSH/portable/openssh-9.6p1.tar.gz

2024/1/20現在の最新版を指定

ソース展開
tar -xzf openssh-9.6p1.tar.gz
ディレクトリ移動
cd openssh-9.6p1
OpenSSLの位置を確認
which openssl
結果確認
/usr/bin/openssl
configure
./configure --with-kerberos5 --with-md5-passwords --with-pam --with-selinux --with-privsep-path=/var/lib/sshd/ --sysconfdir=/etc/ssh --with-ssl-dir=/usr

--with-ssl-dir=/usrは、opensslがあるディレクトリのヘッダを指定

make
make
インストール
sudo make install
再起動
shutdown -r now
バージョンアップされていることを確認
ssh -V
OpenSSH_9.6p1, OpenSSL 3.0.2 15 Mar 2022
サービス起動起動していることを確認
sudo systemctl status ssh.service

active(running)を確認する

参考にしたページ

https://manualmaton.com/2023/12/21/ubuntu20-04%e3%81%aeopenssh%e3%82%928-2p1%e3%81%8b%e3%82%899-6-1p%e3%81%ab%e3%82%a2%e3%83%83%e3%83%97%e3%83%87%e3%83%bc%e3%83%88%e3%80%82/
当方の環境差分以外は、ほぼコピペさせていただきました。

UnuntuのCVE(脆弱性)データベースのステータス見方

The Common Vulnerabilities and Exposures (CVE) system
Released: 脆弱性に対するアップデートがリリースされており、適用可能であることを意味する。
Needs triage: 分析中であり、Ubuntuセキュリティチームが対応を決定する前の段階。脆弱性の影響や重要度に応じて、対応の優先度が決定される。
Needed: 脆弱性に対する修正が必要だが、まだ具体的なアップデートはリリースされていない。
Deferred: 現時点での対応は延期されていることを示す。これは、リソースの制限や脆弱性の影響が限定的であるなど、さまざまな理由による。
Not vulnerable: このステータスは、該当バージョンのUbuntuがその脆弱性の影響を受けないことを示す

当方の環境での設定log

xxx設定ログ

1
1
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
1
1