Error "Connection blocked because server only allows public key authentication. Please contact your network administrator." while performing ssh connection.

Solution Verified - Updated -

Issue

  • Not able to connect via SSH-Key pair authentication

  • Using the same private key to connect from other server, able to authenticate and connect

  • Tried setting public key auth from client end exclusively but it failed with same issue.

    # ssh -vvv -o "PreferredAuthentications=publcikey" <user>@<IP>
    
  • Debug logs does not shows any logs pointing to issue with client system or server system. Connection just gets close with warning "Connection blocked because server only allows public key authentication. Please contact your network administrator." on client end.

  • As per Network team Traffic is allowed and passing for given IP.

Environment

  • Red Hat Enterprise Linux All version

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content