| |
@@ -612,6 +612,17 @@
|
| |
|
| |
%post server
|
| |
%systemd_post sshd.service sshd.socket
|
| |
+ # Migration scriptlet for Fedora 31 and 32 installations to sshd_config
|
| |
+ # drop-in directory (in F32+).
|
| |
+ # Do this only if the file generated by anacond exists, contains our config
|
| |
+ # directive and sshd_config contains include directive as shipped in our package
|
| |
+ %global sysconfig_anaconda /etc/sysconfig/sshd-permitrootlogin
|
| |
+ test -f %{sysconfig_anaconda} && \
|
| |
+ test ! -f /etc/ssh/sshd_config.d/01-permitrootlogin.conf && \
|
| |
+ grep -q '^PERMITROOTLOGIN="-oPermitRootLogin=yes"' %{sysconfig_anaconda} && \
|
| |
+ grep -q '^Include /etc/ssh/sshd_config.d/\*.conf' /etc/ssh/sshd_config && \
|
| |
+ echo "PermitRootLogin yes" >> /etc/ssh/sshd_config.d/01-permitrootlogin.conf && \
|
| |
+ rm %{sysconfig_anaconda} || :
|
| |
|
| |
%preun server
|
| |
%systemd_preun sshd.service sshd.socket
|
| |