Closed. This question is off-topic. It is not currently accepting answers. Learn more
想改进这个问题吗?Update the question所以堆栈溢出的值小于aa>。
两年前关闭。
我可以使用ssh连接到digitalocean服务器:
ssh root@1.1.1.1(具有正确的IP地址)
但是,添加用户后:
adduser git
...
is this information correct?
Y
...

我无法与此新用户进行SSH
ssh git@1.1.1.1
Permission denied (publickey).

为什么我的公钥适用于root,而不适用于git
更新
如果重要的话,我用的是数字海洋。

最佳答案

我知道问题,你面对什么,你需要检查你的钥匙的特权。
更改用户权限。我确实遇到了一个可识别的问题,我可以通过https而不是ssh克隆git。
chmod实用程序将解决您的问题:
这个命令会解决你的问题。

chmod 777 <id_rsa_key(file)>

其他一些常用示例包括:
777 anyone can do anything (read, write, or execute)
755 you can do anything; others can only read and execute
711 you can do anything; others can only execute
644 you can read and write; others can only read

10-07 19:13
查看更多