OCI: UFW Was Enabled on Ubuntu and SSH Connections Started to Fail With Connection Refused Error
An Ubuntu Instance started to experience "Connection Refused" errors when trying to log in to the server using ssh. This issue only started to occur after the Uncomplicated Firewall Service (UFW) was enabled.
1). To fix this, first use the Cloud Shell to log in to the Ubuntu instance via the serial console.
https://docs.oracle.com/en-us/iaas/Content/Compute/References/serialconsole.htm#cloud-shell
2). If the Ubuntu instance is a standard Ubuntu platform image, it is recommended in the OCI: Best Practices Guidelines that UFW is not used, and UFW is disabled by default. If UFW is then subsequently enabled, it can conflict with any iptables rules that have been configured by default using iptables on the Ubuntu instance.