Access denied when trying to pull image on ec2

error pulling image configuration: download failed after attempts=1: error parsing HTTP 403 response body: invalid character ‘<’ looking for beginning of value: “<?xml version=\"1.0\" encoding=\"UTF-8\"?>\nAccessDeniedAccess DeniedF171E161JFF6R65XeSjy1KqX+77aYEONZmgzYiqMXk09dIfEusIzcI5JJkIgiiT9peb0ZlWcBNbZxIuYKTdHQN6/Pzw=”

What are the steps (as in the exact commands!) we need to repeat to get this error message?

I ran docker docker pull ubuntu on my ec2

Da docker pull on a public repository should work with every registry…

I tried but didn’t work on my ec2