After getting and updating firmware recently (also installing nginx), cant reconnect to rpi over ssh (have no other way than ssh).
Was getting
$this->bbcode_second_pass_code('', 'PTY allocation request failed on channel 0
')
After some fiddling and researching I found that my /etc/hosts was empty. But after reinserting the card and few force shutdowns I started getting port 22: connection refused.
I also tried putting 127.0.0.1 localhost and 127.0.0.1 rpi (computer named rpi) to hosts file which didn't seem to help at all.
I remember basically same thing happened with previous rpi installation. After a few days I just got PTY 0 error and couldn't connect, while actually doing absolutely nothing but running it last time.
Edit: Sometimes it just lets me (after sitting in for a while or few reboots) ssh in but then back to PRY failed on channel 0.