Git SSH设置权限被拒绝(publickey)

5
我正在使用Ubuntu 8.04的VWWare虚拟机,设置SSH git访问时遇到了问题。
我收到以下输出:
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: 
debug1: Authentications that can continue: publickey
debug1: Offering public key: 
debug1: Authentications that can continue: publickey
debug1: Offering public key: 
debug1: Authentications that can continue: publickey
debug1: Offering public key: 
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/jars/.ssh/identity
debug1: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
Enter passphrase for key '/home/jars/.ssh/identity': 
debug1: read PEM private key done: type RSA
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
Permission denied (publickey).

我使用ssh-keygen -t rsa生成了密钥,并将它们重命名为identity(私钥)和ida_rsa(公钥),因为最初它们不能被ssh找到。我还创建了一个配置文件,如这里所示...http://help.github.com/troubleshooting-ssh/。但仍然没有改变。我是否漏掉了什么或者在VMWare中使用SSH有什么普遍问题?谢谢。

请注意,管理员:任何关于Git的问题都与超级用户无关。Git是一种编程工具,因此完全属于SO。 - VonC
“private”?我认为ssh rsa私钥的名称是id_rsa,而不是“private”... - VonC
@Von:这不是一个GitHub的问题,而是与创建和使用公钥/私钥有关。 - Josh K
@Von:这与编程有什么关系?Git是一个版本控制系统,我们在这里问Firebug的问题吗?不,他们去SU。 - Josh K
@Von:没问题,我同意纯粹的git问题最好在这里提问。我不会在SU上问sedawk的问题,但我可能会在unix.SE上问。 - Josh K
显示剩余2条评论
1个回答

5

请检查本地和远程端的 .ssh 目录权限:

drwx------ 3 xxx xxx 216 10-04 12:30 .ssh/
-rw------- 1 xxx xxx  745 06-19 12:37 authorized_keys
-rw------- 1 xxx xxx  783 05-08 22:15 config
-rw------- 1 xxx xxx 3.3K 2009-02-21  id_rsa
-rw------- 1 xxx xxx  745 2009-03-06  id_rsa.pub
-rw-r--r-- 1 xxx xxx  53K 09-27 15:51 known_hosts

如果那样不起作用,可以在命令行中以调试模式运行SSH服务器。这可能会给您更多信息,为什么它会拒绝登录。

sudo /usr/sbin/sshd -Dd

谢谢!在调试模式下运行ssh服务器非常有帮助。 - vinod

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接