How can I turn off SSH and HTTP services for everybody except myself?
Background: Our server is running inside a VM. I make a snapshot of the VM before starting maintenance. When something goes wrong, I simply restore the snapshot, so I can start over again. However, if somebody uses the server while I am updating, all of his or her work in that time will be lost when I restore the snapshot. To avoid this, I want to make sure nobody can use the server during maintenance time.
I'm not the owner of the VM, so I can't take it off the network. I need to log on to the server through VPN like everybody else.
HTTP is not needed for maintenance, but I'm not sure if the server likes it if I simply stopped the service. In my case it's a GitLab server that typically refuses to update when its services are down, or its update scripts simply restart the service before migration starts. However, I'm interested in a solution that works for other Ubuntu-based servers, too.