Run the tunnel command again and capture the full error line including the error code. Expected: the code is 4018, confirming an authentication failure rather than a network failure.

Open the ngrok dashboard for the account you intend to use and open its authtoken page. Expected: you can see the current token for that account, with any older tokens shown as revoked.

Run the ngrok config add-authtoken command with that current token in the same terminal user session that will run the tunnel. Expected: the command reports the token was saved to the ngrok configuration file.

Check that the configuration file now exists in that user home directory and was updated just now. Expected: a fresh modification time, which proves the token was not saved under a different user.

If the agent runs as a service or under a different system user, repeat the token setup for that user or configure the service with the same token. Expected: the identity that runs the agent is the identity holding the token.

Start the tunnel again with a simple http tunnel to a running local service, described as the loopback service on its port. Expected: the session connects and the forwarding addresses are displayed.

Open the public forwarding address once to confirm traffic reaches the service. Expected: the service responds through the tunnel instead of an ngrok error page.