fedora_config_packages/ssh/rpmbuild.spec

39 lines
905 B
RPMSpec

Name: ssh-myconf
Version: 1.0
Release: 0.%(perl -e 'print time()')
Summary: Custom ssh configuration
License: MIT
Group: Development/Tools
Requires: openssh
Requires: openssh-clients
Requires: openssh-server
%description
config file for ssh
%pre
rm -f /etc/ssh/sshd_config.myconf
rm -f /root/.ssh/authorized_keys.myconf
%post
cp -f /etc/ssh/sshd_config.myconf /etc/ssh/sshd_config
cp -f /root/.ssh/authorized_keys.myconf /root/.ssh/authorized_keys
%install
mkdir -p %{buildroot}/etc/ssh
cp sshd_config %{buildroot}/etc/ssh/sshd_config.myconf
mkdir -p %{buildroot}/root/.ssh/
cp authorized_keys %{buildroot}/root/.ssh/authorized_keys.myconf
systemctl reload sshd
%files
%defattr(-,root,root,-)
%attr(644,root,root) /etc/ssh/sshd_config.myconf
%attr(600,root,root) /root/.ssh/authorized_keys.myconf
%changelog
* Sat Nov 02 2024 David Rotermund <davrot@uni-bremen.de> - 1.0-1
- Initial RPM release.