Problem: you enabled ufw on your RaspberryPi or OrangePi, but forgot to open the 22 port (rookie mistake)
Solution: manually edit ufw rules
- Eject sd card, connect it to your pc and mount into some directory
- Find
/etc/ufw/user.rules
- Add these lines
### tuple ### allow any 22 0.0.0.0/0 any 0.0.0.0/0 in
-A ufw-user-input -p tcp --dport 22 -j ACCEPT
-A ufw-user-input -p udp --dport 22 -j ACCEPT
- Insert sd card in RaspberryPi or OrangePi
- Boot.