This is expected behavior. The session after some time of inactivity timeouts and in my case this led to my bash terminal session to hang. As I didn't want to terminate and close my terminal to resolve this issue and as well as I wanted to keep my previuos log still available I was looking for a possible solution.
To terminate a hanged ssh session please type the following keys: [enter]~.
root@mycloud:~# ~? Supported escape sequences: ~. - terminate connection (and any multiplexed sessions) ~B - send a BREAK to the remote system ~C - open a command line ~R - Request rekey (SSH protocol 2 only) ~^Z - suspend ssh ~# - list forwarded connections ~& - background ssh (when waiting for connections to terminate) ~? - this message ~~ - send the escape character by typing it twice (Note that escapes are only recognized immediately after newline.) # we waiting now for the session to timeout root@rctest:~# # no press the magica keys :) root@rctest:~# Connection to 22.214.171.124 closed.