我的authorized_keys
文件如下所示:
from='127.0.0.1' ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeAVHd//GTcItdubkzN+FzQYDlEIa9YxKK7jyg/uufjP/aKEMpa6ZVtZQPpzihmGV7uOrSEjC3QMyKz7eFhkej3eb8Igki9HrTwTQphH7RsBYnXBe9OXpDj21P4T0uUY5zHYzzH4Beb31nZxU++MEITfDbl49Ot6JFXS+NmS7O6yWePbOT4EtdriY+kxexkQT3YO/0wxZv1xbNVpguC100VoyzEEKAiCXT5kRDYNkpiHrPircI7D1QRG+9yNbCJYvrq39usB4hHOu5O5TnW1gYeE8gmQBGeKqHb+3fTzLpHGzi1qgOWyTlJX7rfFiu9ZMgcU+B9BPAbpsUZ4Gkx8AH
当我尝试使用 登录时,ssh -4 localhost
我得到了Permission denied (publickey).
但如果删除选项字段,我就可以成功登录。据我从 sshd(8) 所知,我使用的是正确的格式。
答案1
不,格式错误。必须使用双引号。
from="127.0.0.1" ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeAVHd//GTcItdubkzN+FzQYDlEIa9YxKK7jyg/uufjP/aKEMpa6ZVtZQPpzihmGV7uOrSEjC3QMyKz7eFhkej3eb8Igki9HrTwTQphH7RsBYnXBe9OXpDj21P4T0uUY5zHYzzH4Beb31nZxU++MEITfDbl49Ot6JFXS+NmS7O6yWePbOT4EtdriY+kxexkQT3YO/0wxZv1xbNVpguC100VoyzEEKAiCXT5kRDYNkpiHrPircI7D1QRG+9yNbCJYvrq39usB4hHOu5O5TnW1gYeE8gmQBGeKqHb+3fTzLpHGzi1qgOWyTlJX7rfFiu9ZMgcU+B9BPAbpsUZ4Gkx8AH