Skip to content

Instantly share code, notes, and snippets.

@t-okkn
Last active March 17, 2021 06:42
Show Gist options
  • Save t-okkn/9c5c1ca2a230168b7fecd79545f2278c to your computer and use it in GitHub Desktop.
Save t-okkn/9c5c1ca2a230168b7fecd79545f2278c to your computer and use it in GitHub Desktop.
オレオレ式、SSHサーバ標準設定メモ

オレオレ式、SSHサーバ標準設定

■前提

OpenSSH 7.4p1にて検証した手順です。
※「{{ }}」にて囲まれている部分は変数を表します(Jinja2などのテンプレートエンジンでもレンダリング可能なようにしてあります)。

sshd_configの設定

設定を変更する部分のみ記載。

$ sudo vi /etc/ssh/sshd_config
==========
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key

PublicAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
PasswordAuthentication no
AllowTCPForwarding yes
TCPKeepAlive yes
UsePAM no
==========

【備忘】公開鍵と秘密鍵の作成方法

$ ssh-keygen -t ed25519 -C "{{ Comment }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment