I have connected to my Ubuntu box using its serial port on windows(using putty connection is working fine.)
According to the question https://serverfault.com/questions/892892/how-to-use-ssh-over-serial-without-using-pppd-or-how-to-transfer-tcp-over-ser, it appears I should be able to SSH into the machine over a serial port.
What packages are needed or alternatively how do I set this up?
http://patrickst.blogspot.com/2011/11/tcpip-over-slip-on-gnulinux-ubuntu.html
https://learn.adafruit.com/welcome-to-circuitpython/advanced-serial-console-on-mac-and-linux