0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

OpenSSH バイナリインストール

Posted at

バイナリファイルをダウンロード

wget https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.4p1.tar.gz

ダウンロードしたファイルを展開

tar -xvf openssh-9.4p1.tar.gz
cd openssh-9.4p1

ダウンロードしたファイルを展開

sudo mkdir -p /usr/local/openssh
sudo cp ssh /usr/local/openssh/
sudo cp scp /usr/local/openssh/
sudo cp sshd /usr/local/openssh/

パスを通す

export PATH=$PATH:/usr/local/openssh
echo 'export PATH=$PATH:/usr/local/openssh' >> ~/.bashrc

サービスとして設定

sudo cp ./sshd_config /etc/ssh/

サービススクリプトを作成

sudo nano /etc/systemd/system/ssh.service

内容

[Unit]
Description=OpenSSH Daemon
After=network.target

[Service]
ExecStart=/usr/local/openssh/sshd -D
Restart=always

[Install]
WantedBy=multi-user.target

サービスを有効化・起動

sudo systemctl daemon-reload
sudo systemctl enable ssh
sudo systemctl start ssh

動作確認

sudo systemctl status ssh

ファイアウォールの設定

sudo firewall-cmd --add-service=ssh --permanent
sudo firewall-cmd --reload
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?