dreamhost - Dreamhost 上的 SSH key

标签 dreamhost ssh-keys

我正在尝试设置一个与 Dreamhost 和我的本地机器配对的 SSH key 。我使用 git bash 作为我的终端(使用 mingw32)

我可以通过 ssh myusername@mysharedserver.com 并要求我输入密码。我已经在本地和共享的 Dreamhost 服务器上创建了 RSA key 。以下是我在 git 终端上采取的步骤:

$ scp ~/.ssh/id_rsa.pub myusername@mysharedserver.com:~/

$ ssh myusername@mysharedserver.com
myusername@mysharedserver.com's password: *****
$ (ls shows my local's id_rsa.pub in the ~ directory)
$ cd ~/.ssh
$ ls
id_rsa id_rsa.pub key_backup
$ cat ./id_rsa.pub >> authorized_keys (i know I could have just copied)
$ ls
authorized_keys id_rsa id_rsa.pub key_backup

vi authorized_keys shows my local's pubkey

$ chmod go-w ~
$ chmod 700 ~/.ssh
$ chmod 600 ~/.ssh/authorized_keys

然后我退出 ssh 连接并在本地 shell 中输入 ssh myusername@mysharedserver.com

我被要求输入密码......我在这里做错了什么?

我需要设置 ssh-agent 吗?当我这样做并尝试 ssh-add 时,我得到“无法打开与您的身份验证代理的连接”

谢谢你的帮助!

编辑:这是 ssh -v 的转储
$ ssh -v myusername@mysharedserver.com
OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007
debug1: Connecting to mysharedserver.com [xxx.xxx.xxx.xx] port 22.
debug1: Connection established.
debug1: identity file /c/Users/User/.ssh/identity type -1
debug1: identity file /c/Users/User/.ssh/id_rsa type 1
debug1: identity file /c/Users/User/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1p1 Debia
n-5
debug1: match: OpenSSH_5.1p1 Debian-5 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.6
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<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 'mysharedserver.com' is known and matches the RSA host key.
debug1: Found key in /c/Users/User/.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,password
debug1: Next authentication method: publickey
debug1: Trying private key: /c/Users/User/.ssh/identity
debug1: Offering public key: /c/Users/User/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /c/Users/User/.ssh/id_dsa
debug1: Next authentication method: password
myusername@mysharedserver.com's password:

最佳答案

我最近遇到了类似的问题。检查服务器上的权限:

  • ~/(整个主目录)组和其他人的 755 或更低 - 这对我来说是问题的原因我有 765
  • ~/.ssh 700
  • ~/.ssh/authorized_keys 600

  • 更新:

    encryptfs 也可能存在问题,详情请见:
    https://serverfault.com/questions/310827/ssh-prompts-for-password-even-though-private-keys-are-available-presented-to-se/310829#310829

    关于dreamhost - Dreamhost 上的 SSH key ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8363903/

    相关文章:

    php - 无法连接到 Dreamhost 的数据库

    ruby-on-rails-3 - 让 Rails 在生产中显示开发风格错误

    github - 通过工作流程自动从 Github 推送到 Dreamhost

    git - 如何指定 `go get` 将使用哪个 ssh key

    ios - SSH 协商 : Bad SSH2_MSG_KEX_DH_GEX_REPLY or something else?

    ssh-keys - terraform 是否支持 ssh 密码保护 key ?

    ruby-on-rails - DreamHost 共享主机上的 rails 3.2.8 ruby​​ 1.9.3 fcgi RMagic 问题

    php - 如何在 Dreamhost 上设置 memory_limit php 5.3

    python - 使用 Paramiko 更改主机 key 时自动更新 known_hosts 文件

    ssh - rhc 的自定义 ssh key 位置