AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

    • 主页
    • 系统&网络
    • Ubuntu
    • Unix
    • DBA
    • Computer
    • Coding
    • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 10140
Accepted
Roy Rico
Roy Rico
Asked: 2009-05-20 14:36:31 +0800 CST2009-05-20 14:36:31 +0800 CST 2009-05-20 14:36:31 +0800 CST

SSH 键 + RHEL5

  • 772

我已经能够在我的 ubuntu、fedora core 和 mac 系统上设置 SSH 身份验证密钥,但是,我无法让 SSH 密钥在 redhat Enterprise linux 5 (RHEL5) 上正常工作。我尝试使用 2048 位加密创建密钥,但似乎没有任何效果。这是我尝试通过我的 mac osx leopard (10.5.7) 连接时得到的调试输出

我已经检查了权限,但我无法弄清楚...谢谢

更新:我已经检查了我的权限,它们是 0700 用于 .ssh,0600 用于 .ssh/authorized_keys

royrico@mac ~ $ ssh -vv linuxbox
OpenSSH_5.1p1, OpenSSL 0.9.7l 28 Sep 2006
debug1: Reading configuration data /etc/ssh_config
debug2: ssh_connect: needpriv 0
debug1: Connecting to linuxbox [192.168.2.3] port 22.
debug1: Connection established.
debug1: identity file /Users/royrico/.ssh/identity type -1
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug2: key_type_from_name: unknown key type '-----END'
debug1: identity file /Users/royrico/.ssh/id_rsa type 1
debug1: identity file /Users/royrico/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_4.3
debug1: match: OpenSSH_4.3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.1
debug2: fd 3 setting O_NONBLOCK
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: mac_setup: found hmac-md5
debug1: kex: server->client aes128-cbc hmac-md5 none
debug2: mac_setup: found hmac-md5
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
debug2: dh_gen_key: priv key bits set: 138/256
debug2: bits set: 493/1024
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'linuxbox' is known and matches the RSA host key.
debug1: Found key in /Users/royrico/.ssh/known_hosts:1
debug2: bits set: 504/1024
debug1: ssh_rsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /Users/royrico/.ssh/identity (0x0)
debug2: key: /Users/royrico/.ssh/id_rsa (0x107ea0)
debug2: key: /Users/royrico/.ssh/id_dsa (0x0)
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Next authentication method: publickey
debug1: Trying private key: /Users/royrico/.ssh/identity
debug1: Offering public key: /Users/royrico/.ssh/id_rsa
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Trying private key: /Users/royrico/.ssh/id_dsa
debug2: we did not send a packet, disable method
debug1: Next authentication method: password
royrico@linuxbox's password: 
ssh rhel5
  • 5 5 个回答
  • 5054 Views

5 个回答

  • Voted
  1. Best Answer
    Dave Cheney
    2009-05-20T17:44:23+08:002009-05-20T17:44:23+08:00

    检查~/.ssh/authorized_keys文件的权限。他们应该是0600。

    % chmod 0700 .ssh
    % chmod 0600 .ssh/authorized_keys
    

    是我的标准模式

    更新:检查您的主目录是否由您单独拥有,确保您的主组没有对您的主目录的写入权限。有一个附加向量,如果您的主要组中的某个人对您.ssh的根目录具有写入权限,他们可以将您的目录移走$HOME

    • 3
  2. Zoredache
    2009-05-20T15:24:01+08:002009-05-20T15:24:01+08:00
    debug2: key_type_from_name: unknown key type '-----BEGIN'
    debug2: key_type_from_name: unknown key type '-----END'
    

    这些消息看起来非常重要。您的身份文件中似乎有错误类型的密钥。

    • 0
  3. Charles Hepner
    2009-05-20T17:49:55+08:002009-05-20T17:49:55+08:00

    生成密钥对时,通常有一个名为 id_rsa.pub 或 id_dsa.pub 的公钥。该文件的内容是粘贴到远程服务器上的 authorized_keys 文件中的内容。仔细检查以确保您将密钥对的公共部分添加到了 authorized_keys。

    私钥通常与您的公钥命名相同,但没有 .pub 扩展名,例如 id_rsa 或 id_dsa。也许您的本地系统找不到要使用的正确私钥?试试ssh -i /path/to/private/key linuxbox。

    • 0
  4. raspi
    2009-05-20T22:32:54+08:002009-05-20T22:32:54+08:00

    它不应该需要超过(示例)

    ssh-keygen -t rsa 
    ssh-copy-id -i ~/.ssh/id_rsa.pub user@host.tld
    ssh-copy-id -i ~/.ssh/id_rsa.pub another@host2.tld
    ssh-copy-id -i ~/.ssh/id_rsa.pub etc@etc.tld
    
    • 0
  5. Xinity
    2009-05-27T10:43:20+08:002009-05-27T10:43:20+08:00

    哼快速问题你的selinux设置如何?getenforce 说什么?如果您还没有停用 selinux,也许您可​​以查看 /var/log/audit.log 并使用 audit2why: http: //linux.die.net/man/8/audit2why

    或者你也可以停用 selinux,编辑 /etc/sysconfig/selinux

    希望这可以帮助

    • 0

相关问题

  • Mac OS X:如何在无头机器上运行 GUI 应用程序

  • Windows SSH 客户端

  • 在 Windows Server 2003 上通过 SSH 启动和停止 Mongrel 服务

  • 隧道 Xbox 网络流量 [关闭]

  • 为什么使用authorized_keys通过ssh自动登录不起作用?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    从 IP 地址解析主机名

    • 8 个回答
  • Marko Smith

    如何按大小对 du -h 输出进行排序

    • 30 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    Windows 中执行反向 DNS 查找的命令行实用程序是什么?

    • 14 个回答
  • Marko Smith

    如何检查 Windows 机器上的端口是否被阻塞?

    • 4 个回答
  • Marko Smith

    我应该打开哪个端口以允许远程桌面?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    MikeN 在 Nginx 中,如何在维护子域的同时将所有 http 请求重写为 https? 2009-09-22 06:04:43 +0800 CST
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    0x89 bash中的双方括号和单方括号有什么区别? 2009-08-10 13:11:51 +0800 CST
  • Martin Hope
    kch 如何更改我的私钥密码? 2009-08-06 21:37:57 +0800 CST
  • Martin Hope
    Kyle Brandt IPv4 子网如何工作? 2009-08-05 06:05:31 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助
subwaysurfers
my femboy roommate

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve