skip to Main Content

I’m trying to connect to my server where I have Magento installed.
I loaded the key on my windows cmd with ssh-add, and then connected with:

ssh -pPORT user@server

and I get:

Permission denied (publickey).

How can I fix this? I can’t run chmod 600 on windows and already checked the permissions on the key file and are ‘full control’

2

Answers


  1. A permission denied, as commented, means SSH does connect, but does not find the right public key to validate the private one used locally.

    Try ssh -Tv -pPORT user@server to see what key is used locally.

    Then make sure your public key is copied to the remote server, in ~user/.ssh/id_rsa.pub (replace "user" by the actual user account name you need in your case)

    Login or Signup to reply.
  2. This error usually means your key hasn’t been added to the authorized keys list on the host machine. You can either manually add the public key to the server, or use the following command from the machine you’re using to connect to the server.

    ssh-copy-id -pPORT user@server
    

    This will require you to enter the users password first time, but will then copy your public key onto the host/server to allow key based authentication next time you login.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search