So the title says it all. I setup an ec2 instance on AWS running Ubuntu 16.04 LTS for a web server. When enabling the firewall, and opening ports needed for a web access (HTTP, FTP, ect.), I didn't think to enable port 22 for the SSH connection I use to connect to the server. Naturally I'm unable to remote into my server via SSH to manage it since its now being blocked by UFW. Luckily I'm still able to connect via FTP so I have access to all of the systems files. What are my options to get port 22 on the UFW open?
If you've done nothing else yet, blow-away the instance, and redo it. That's the best, simplest, and fastest solution.
Does Amazon have a recovery console for instances? I seem to recall they do. If they do, you could reboot the instance into a rescue mode,
chroot into it, and change UFW settings that way.
You might also be able to upload a replacement
sshd_config and move sshd to listen on port 80.
Then upload an httpd config that changes its listening port to, say, 8080.
Then reboot, and ssh on port 80.
You could create a replacement ssh configuration file and change the port number so that it listens on a port which is open by default and then upload this using ftp and restart the instance of Ubuntu. This would cause ssh to listen on that port, by when you can then change the ufw settings so that ssh can work in port 22.