noobient / noobuntu

Enterprise Ubuntu development environment with Active Directory integration
MIT License
6 stars 3 forks source link

UFW setup fails if openssh-server rule is missing #26

Closed bviktor closed 4 years ago

bviktor commented 4 years ago

Just installing openssh-server is not enough, if the package was once installed, but later removed, and the rule has been removed manually as well.

dpkg-reconfigure openssh-server won't reinstate the file either. So do something like this:

if (openssh-server.installed && /etc/ufw/applications.d/openssh-server.exists == false)
{
    apt purge openssh-server
    apt install openssh-server
}