SSH Key: “Permissions 0644 for 'id_rsa.pub' are too open.” on mac

后端 未结 17 2191
[愿得一人]
[愿得一人] 2020-11-28 00:50

I generate a ssh key pair on my mac and add the public key to my ubuntu server(in fact, it is a virtual machine on my mac),but when I try to login the ubuntu server,it says:

17条回答
  •  长情又很酷
    2020-11-28 01:16

    debug1: identity file /Users/tudouya/.ssh/vm/vm_id_rsa.pub type 1
    

    It appears that you're trying to use the wrong key file. The file with the ".pub" extension contains the public portion of the key. The corresponding file without the ".pub" extension contains the private part of the key. When you run an ssh client to connect to a remote server, you have to provide the private key file to the ssh client.

    You probably have a line in the your .ssh/config file (or /etc/ssh_config) which looks like this:

    IdentityFile .../.ssh/vm/vm_id_rsa.pub
    

    You need to remove the ".pub" extension from the filename:

    IdentityFile .../.ssh/vm/vm_id_rsa
    

提交回复
热议问题