从Amazon EC2实例中,我创build了一个新用户webserver ,并创build了一个只能由webserver访问的git存储库,而不是默认用户。 我希望从我的家用电脑(也是Linux)克隆,推送和从存储库中取出。
以下是当我尝试克隆目前(敏感信息被拒绝)时所得到的结果:
git clone webserver@ec2-***.compute.amazonaws.com:/home/webserver/path/to/repo reponame
给出以下答复:
Cloning into 'reponame'... Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
我需要做些什么才能正确获得公钥保护设置?
好吧,我只需要把我的公钥放到我的电脑里〜/ .ssh / authorized_keys就可以正常工作了。 由于该文件不存在,因此公钥成为该文件的唯一内容。