mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/boypt/openssh-rpms.git
synced 2026-09-20 08:03:38 +08:00
docs: cover both sshd_config paths in Install RPMs
This commit is contained in:
17
README.md
17
README.md
@@ -124,7 +124,9 @@ ls output
|
|||||||
# you will find multiple RPM files in this directory.
|
# you will find multiple RPM files in this directory.
|
||||||
# you may copy them to other machines, and continue following steps there.
|
# you may copy them to other machines, and continue following steps there.
|
||||||
|
|
||||||
# Backup current SSH config
|
# Backup current SSH config by moving it away — the new package then
|
||||||
|
# lays down a fresh stock config, which also avoids breakage from old
|
||||||
|
# directives (notably the GSSAPI* series) removed upstream.
|
||||||
[[ -f /etc/ssh/sshd_config ]] && mv /etc/ssh/sshd_config /etc/ssh/sshd_config.$(date +%Y%m%d)
|
[[ -f /etc/ssh/sshd_config ]] && mv /etc/ssh/sshd_config /etc/ssh/sshd_config.$(date +%Y%m%d)
|
||||||
|
|
||||||
# Install rpm packages (`dnf` works the same on EL8/EL9).
|
# Install rpm packages (`dnf` works the same on EL8/EL9).
|
||||||
@@ -133,13 +135,14 @@ sudo yum --disablerepo=* localinstall -y ./openssh*.rpm
|
|||||||
# Check Installed version:
|
# Check Installed version:
|
||||||
ssh -V && /usr/sbin/sshd -V
|
ssh -V && /usr/sbin/sshd -V
|
||||||
|
|
||||||
# Test the current sshd_config against the new binary FIRST — old
|
# If you skipped the backup step above, rpm kept your old config and
|
||||||
# directives (notably the GSSAPI* series) were removed upstream and
|
# saved the package defaults as sshd_config.rpmnew (the spec marks it
|
||||||
# will keep the new sshd from starting. If it fails, either fix the
|
# %config(noreplace)). An old config can keep the new sshd from
|
||||||
# offending directives, or fall back to the package defaults shipped
|
# starting, so test it — on failure either fix the offending
|
||||||
# as .rpmnew (your old config is already backed up above):
|
# directives, or swap in the .rpmnew defaults, then re-test until it
|
||||||
|
# passes silently:
|
||||||
|
ls /etc/ssh/sshd_config.rpmnew
|
||||||
sudo /usr/sbin/sshd -t -f /etc/ssh/sshd_config || sudo mv /etc/ssh/sshd_config{.rpmnew,}
|
sudo /usr/sbin/sshd -t -f /etc/ssh/sshd_config || sudo mv /etc/ssh/sshd_config{.rpmnew,}
|
||||||
# Re-test until it passes silently before restarting:
|
|
||||||
sudo /usr/sbin/sshd -t -f /etc/ssh/sshd_config
|
sudo /usr/sbin/sshd -t -f /etc/ssh/sshd_config
|
||||||
|
|
||||||
# Restart service
|
# Restart service
|
||||||
|
|||||||
Reference in New Issue
Block a user