Created
November 24, 2020 01:59
-
-
Save heiwa4126/f11de1a887b9f49af70bf5533fe518d7 to your computer and use it in GitHub Desktop.
Regenerate OpenSSH Host Keys on RHEL7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ubuntuの
dpkg-reconfigure openssh-server
みたいなやつ。