SSH给我一个许可被拒绝! [英] ssh giving me a permission denied!

查看:202
本文介绍了SSH给我一个许可被拒绝!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不完全是这方面的专家,但我确信我已经在这里覆盖了所有的东西。



我写了这个:

  $ ssh-keygen -t rsa -Ctekkub@gmail.com
生成公钥/私钥rsa密钥对。
输入要保存密钥的文件(/Users/tekkub/.ssh/id_rsa):
输入密码(空密码):
再次输入相同的密码:
您的身份证明已保存在/Users/tekkub/.ssh/id_rsa中。
您的公钥已保存在/Users/tekkub/.ssh/id_rsa.pub中。
关键指纹是:
01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db tekkub@gmail.com
钥匙的randomart图像是:
+ - [RSA 2048] ---- +
| 。+ + |
| = o O。 |
| = * * |
| o = + |
| S。 |
| o o = |
| o。 E |
| |
| |
+ ----------------- +



<然后我 pbcopy '将信息传递给我的github帐户。保存它。执行 ssh git@github.com ,并按预期工作。

然后,我设置了我的配置文件。
$ b 主机hq
主机名75.101.0.93
用户合唱
IdentityFile〜/ .ssh / id_rsa
StrictHostKeyChecking no
>

然后我试过 ssh hq

  Permission Denied 

我这样做:

  chmod 700〜/ .ssh 
chmod 600〜/ .ssh / *

再试一次..没什么。



试过这个:

ssh-keygen -t dsa -Ctekkub@gmail.com

创建了一个新的pub,new key,并且失败了。



我跑这个:

  Gladys-MacBook-Pro:.ssh larrykain $ ssh -v hq 
OpenSSH_5.2p1,OpenSSL 0.9.8l 2009年11月5日
debug1:读取配置数据/Users/larrykain/.ssh/config
debug1:应用hq
的选项debug1:Reading配置数据/ etc / ssh_config
debug1:Connectin g到75.101.o.93 [75.101.o.93]端口22.
debug1:建立连接。
debug1:身份文件/Users/larrykain/.ssh/id_rsa类型1
debug1:远程协议版本2.0,远程软件版本OpenSSH_5.1
debug1:匹配:OpenSSH_5.1 pat OpenSSH *
debug1:为协议2.0启用兼容模式
debug1:本地版本字符串SSH-2.0-OpenSSH_5.2
debug1:SSH2_MSG_KEXINIT发送
debug1:SSH2_MSG_KEXINIT收到
debug1: kex:server-> client aes256-ctr hmac-md5 none
debug1:kex:client-> server aes256-ctr hmac-md5 none
debug1:SSH2_MSG_KEX_DH_GEX_REQUEST(1024< 4096< 8192)sent
DEBUG1:预计SSH2_MSG_KEX_DH_GEX_GROUP
DEBUG1:SSH2_MSG_KEX_DH_GEX_INIT发送
DEBUG1:预计SSH2_MSG_KEX_DH_GEX_REPLY
DEBUG1:主机'75 .101.0.93' 是已知的,RSA主机密钥相匹配。
debug1:找到密钥在/Users/larrykain/.ssh/known_hosts:2
debug1:ssh_rsa_verify:签名正确
debug1:SSH2_MSG_NEWKEYS发送
debug1:期待SSH2_MSG_NEWKEYS
debug1:SSH2_MSG_NEWKEYS收到
debug1:SSH2_MSG_SERVICE_REQUEST发送
debug1:收到SSH2_MSG_SERVICE_ACCEPT
debug1:可继续的身份验证:publickey
debug1:下一个身份验证方法:publickey
debug1:提供公钥:/Users/larrykain/.ssh/id_rsa
debug1:可继续的身份验证:publickey
debug1:提供公钥:/Users/larrykain/.ssh/id_rsa
debug1:身份验证可以继续:publickey
debug1:没有更多的身份验证方法可以尝试。
权限被拒绝(publickey)。

任何人都知道这是怎么回事?

解决方案

您需要 cat〜/ .ssh / id_rsa.pub>>的〜/ .ssh / authorized_keys中我不知道如何在github上执行此操作,但密钥必须位于authorized_keys列表中。



糟糕,现在我明白了你试图回到你控制的盒子。不是问题:)


I'm not exactly an expert at this, but I'm pretty sure I have covered everything here.

I wrote this :

$ ssh-keygen -t rsa -C "tekkub@gmail.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/tekkub/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/tekkub/.ssh/id_rsa.
Your public key has been saved in /Users/tekkub/.ssh/id_rsa.pub.
The key fingerprint is:
01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db tekkub@gmail.com
The key's randomart image is:
+--[ RSA 2048]----+
|     .+   +      |
|       = o O .   |
|        = * *    |
|       o = +     |
|      o S .      |
|     o o =       |
|      o . E      |
|                 |
|                 |
+-----------------+

Then I pbcopy'd the info to my github account. Saved it. Performed ssh git@github.com and it worked as expected.

Then I set up my config file..

Host hq Hostname 75.101.0.93 User alorus IdentityFile ~/.ssh/id_rsa StrictHostKeyChecking no

Then I tried ssh hq :

Permission Denied

I did this:

chmod 700 ~/.ssh
chmod 600 ~/.ssh/*

Tried again.. nothing.

Tried this :

ssh-keygen -t dsa -C "tekkub@gmail.com"

created a new pub, new key, and it failed.

I ran this:

Gladys-MacBook-Pro:.ssh larrykain$ ssh -v hq
OpenSSH_5.2p1, OpenSSL 0.9.8l 5 Nov 2009
debug1: Reading configuration data /Users/larrykain/.ssh/config
debug1: Applying options for hq
debug1: Reading configuration data /etc/ssh_config
debug1: Connecting to 75.101.o.93 [75.101.o.93] port 22.
debug1: Connection established.
debug1: identity file /Users/larrykain/.ssh/id_rsa type 1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1
debug1: match: OpenSSH_5.1 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.2
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes256-ctr hmac-md5 none
debug1: kex: client->server aes256-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<4096<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host '75.101.0.93' is known and matches the RSA host key.
debug1: Found key in /Users/larrykain/.ssh/known_hosts:2
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /Users/larrykain/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Offering public key: /Users/larrykain/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
Permission denied (publickey).

Anyone know what's up?

解决方案

You need to cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys. I don't know how specifically to perform this on github, but the key must be on the authorized_keys list.

Oops, now I see you're trying to get back to a box you control. Not a problem :)

这篇关于SSH给我一个许可被拒绝!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆