Ssh
Freebsd ssh 密鑰不起作用
我在 freebsd vps 上的 ssh 密鑰有問題。我生成了一個密鑰,它可以在 debian 上執行。我通常只是將它複製粘貼到
~/.ssh/authorized_keys
它開始工作。在freebsd中它沒有。我試著把它放進去~/.ssh/authorized_keys2
仍然不響鈴..我的鑰匙有一個密碼階段。因此,當我登錄 osx 密碼視窗彈出視窗輸入密碼時,在我按下 ok 後它說ident added to id_rsa
,然後 ssh 仍然在 shell 中要求輸入密碼。我的筆記型電腦是 osx lion。工作的伺服器是 debian 6 擠壓伺服器,它不工作 freebsd8.2
更新:
ssh 詳細輸出:
Romans-MacBook-Pro:~ holms$ ssh -v holms@xxx.nl OpenSSH_5.6p1, OpenSSL 0.9.8r 8 Feb 2011 debug1: Reading configuration data /etc/ssh_config debug1: Applying options for * debug1: Connecting to xxx.nl [xx.xx.xx.xx] port 22. debug1: Connection established. debug1: identity file /Users/holms/.ssh/id_rsa type -1 debug1: identity file /Users/holms/.ssh/id_rsa-cert type -1 debug1: identity file /Users/holms/.ssh/id_dsa type -1 debug1: identity file /Users/holms/.ssh/id_dsa-cert type -1 debug1: Remote protocol version 2.0, remote software version OpenSSH_5.4p1 FreeBSD-20100308 debug1: match: OpenSSH_5.4p1 FreeBSD-20100308 pat OpenSSH* debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_5.6 debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: server->client aes128-ctr hmac-md5 none debug1: kex: client->server aes128-ctr 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 'roman.travelbird.nl' is known and matches the RSA host key. debug1: Found key in /Users/holms/.ssh/known_hosts:3 debug1: ssh_rsa_verify: signature correct debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: Roaming not allowed by server debug1: SSH2_MSG_SERVICE_REQUEST sent debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey,keyboard-interactive debug1: Next authentication method: publickey debug1: Offering RSA public key: /Users/holms/.ssh/id_rsa debug1: Authentications that can continue: publickey,keyboard-interactive debug1: Trying private key: /Users/holms/.ssh/id_rsa debug1: PEM_read_PrivateKey failed debug1: read PEM private key done: type <unknown> debug1: read PEM private key done: type RSA Identity added: /Users/holms/.ssh/id_rsa (/Users/holms/.ssh/id_rsa) debug1: read PEM private key done: type RSA debug1: Authentications that can continue: publickey,keyboard-interactive debug1: Trying private key: /Users/holms/.ssh/id_dsa debug1: Next authentication method: keyboard-interactive Password: debug1: Authentication succeeded (keyboard-interactive). Authenticated to roman.travelbird.nl ([94.23.147.31]:22). debug1: channel 0: new [client-session] debug1: Requesting no-more-sessions@openssh.com debug1: Entering interactive session. debug1: Sending environment. debug1: Sending env LANG = en_US.UTF-8 Last login: Fri Jan 27 16:11:33 2012 from 46.145.76.30 Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD 8.2-RELEASE (GENERIC) #0: Thu Feb 17 02:41:51 UTC 2011 ( ( ( )\ ) )\ ) )\ ) (()/( ) ) ( ( (()/((()/( /(_)) ( ( ( /( ( )\ )\ /(_))/(_)) (_)) )\ )\ ' )(_)) )\ )((_)((_)(_)) (_)) | _ \ ((_) _((_)) ((_)_ _(_/(\ \ / / | _ \/ __| | // _ \| ' \()/ _` || ' \))\ V / | _/\__ \ |_|_\\___/|_|_|_| \__,_||_||_| \_/ |_| |___/ $
問題解決了:
看來,當我複制公鑰時,以某種方式在每個空格之後添加了中斷空格。當我刪除它們時,一切正常。thnx natxo_asenjo 提示