[英]Trying connect SSH get Permission denied (publickey)
I'm trying to connect to my server where I have Magento installed.我正在尝试连接到安装了 Magento 的服务器。 I loaded the key on my windows cmd with ssh-add, and then connected with:
我用 ssh-add 在我的 windows cmd 上加载了密钥,然后连接:
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'
我无法在 windows 上运行 chmod 600 并且已经检查了密钥文件的权限并且是“完全控制”
A permission denied, as commented, means SSH does connect, but does not find the right public key to validate the private one used locally.如评论所述,权限被拒绝意味着 SSH 确实连接,但找不到正确的公钥来验证本地使用的私钥。
Try ssh -Tv -pPORT user@server
to see what key is used locally.试试
ssh -Tv -pPORT user@server
看看本地用的是什么密钥。
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)然后确保将您的公钥复制到远程服务器,在
~user/.ssh/id_rsa.pub
中(用您需要的实际用户帐户名替换“用户”)
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.这将要求您第一次输入用户密码,但随后会将您的公钥复制到主机/服务器上,以便在您下次登录时允许基于密钥的身份验证。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.