Hello,
Since you can ping your remote host, it won't be a network issue.
From the Erro "Access denied", authentication maybe failed. You could check your credential (if you are a local admin, remote server cannot authenticate)
You can set access to everyone to double confirm if it is an authentication issue.
If the Answer is helpful, please click "Accept Answer" and upvote it.