Skip to content

Instantly share code, notes, and snippets.

@heiwa4126
Created November 24, 2020 01:59
Show Gist options
  • Save heiwa4126/f11de1a887b9f49af70bf5533fe518d7 to your computer and use it in GitHub Desktop.
Save heiwa4126/f11de1a887b9f49af70bf5533fe518d7 to your computer and use it in GitHub Desktop.
Regenerate OpenSSH Host Keys on RHEL7
cd /etc/ssh
rm -f ssh_host_*key*
ssh-keygen -A
rm ssh_host_key ssh_host_key.pub -f
chmod 0640 ssh_host_*key
chown root:ssh_keys ssh_host_*key
chmod 0644 ssh_host_*key.pub
#
systemctl restart sshd
@heiwa4126
Copy link
Author

Ubuntuのdpkg-reconfigure openssh-serverみたいなやつ。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment