Well, I was doing some server setup reading this article and ran the following commands -
sudo apt-get install ufw
sudo ufw enable
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
This basically closed all other ports and now SSH is not working at all. From the browser or from osx terminal.
I have connected via serial login and can see ufw blocking connections -
[ 1292.322021] [UFW BLOCK] IN=eth0 OUT= MAC=... SRC=00.00.00.00 DST=10.142.0.2 LEN=60 TOS=0x00 PREC=0x00 TTL=45 ID=7906 PROTO=TCP SPT=58028 DPT=22 WINDOW=60720 RES=0x00 SYN URGP=0
Is there any way to ssh now as I am unable to access the machine at all.