This key cannot start tunnels: create a key with the tunnels:connect scope
FATA[12:00:00] This key cannot start tunnels: create a key with the tunnels:connect scope
Code: Forbidden
Request ID: 7f2a9c41e0b85d36a1c4f9e02b7d6538
tuna CLI and Tuna Desktop show this error when a tunnel starts with an API key. The client doesn't reconnect and exits right away.
tuna login --with-api-key saves such a key but warns:
WARN[12:00:00] This api key cannot start tunnels: create a key with the tunnels:connect scope to use it for tunnels
Cause
The API key lacks the Run tunnels permission (tunnels:connect). Such a key works with the API and with commands like tuna domain within its permissions, but it can't start a tunnel.
What to do
- Create a new API key: select the For tunnels preset or enable the Run tunnels permission.
- Pass it to the tunnel: in the
TUNA_API_KEYvariable, with the--api-keyflag, or save it withtuna login --with-api-key. - If you need the key without the tunnel permission for API commands, keep it for them and pass the new key to the tunnel with the
--api-keyflag.
Your own computer doesn't need a key for tunnels: log in with tuna login. See Sessions and API keys for details.