UniFi allows connecting to the debug terminal on Access Points, Switches etc from the web interface. However they no longer provides an option to log directly into the Cloud Gateways ( Cloud Key, UDM, UDMP etc).
However it can be done with a simple hack, this will work only if you have at-least one Access Point connected to the same network as the Cloud Gateway.
Enable Debug Tools
Log into the UniFi network application and, under Settings -> Advanced enable the Debug Tools option.
Enable SSH on Cloud Gateway and set a password.
Now go to OS Settings, navigate to Console Settings tab and enable the SSH option. Set up a password as well.
From the About screen, get the local IP as well.
Now go back to Network app and under Devices, pick any AP and open it's Debug terminal.
Once the terminal is open, just SSH into the Cloud Gateway :)
ssh root@<Cloud Gatewau IP>