最速怪談選手権

多段でsftpは使えない?

公開鍵接続により、sftpをバッチファイルモードで使おうとしているのですが、別のサーバから多段でログインした場合に接続ができません。サーバは共にLinuxです。

例えば、ローカルサーバがA、リモートサーバがBとすると、
サーバAでsftpコマンドを打って、サーバBにsftp接続する事は可能なのですが、第三のサーバCからいったんサーバAに入り、それからサーバA上でsftpコマンドを打ってサーバBに接続しようとしても接続が出来ません。

つまり、A→Bの接続は可能なのですが、C→A→Bの接続をやろうとすると失敗します。公開鍵は、サーバA上にて作成しています。

公開鍵による多段のsftp接続は不可能なのでしょうか?

A 回答 (1件)

普通に接続出来ましたが・・・・



技術的に考えてサーバーBはホスト(?)Cの存在を認識しないので問題は無いはずです。
ログに何か出ていませんか?

この回答への補足

ログです。

% sftp -b a.bat hoge@xxx.xxx.xxx.xxx
OpenSSH_5.1p1 Debian-6ubuntu2, OpenSSL 0.9.8g 19 Oct 2007
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to xxx.xxx.xxx.xxx [xxx.xxx.xxx.xxx] port 22.
debug1: Connection established.
debug1: identity file /home/xxx/.ssh/id_rsa type 1
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
debug1: identity file /home/xxx/.ssh/id_dsa type 2
debug1: Checking blacklist file /usr/share/ssh/blacklist.DSA-1024
debug1: Checking blacklist file /etc/ssh/blacklist.DSA-1024
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.6
debug1: match: OpenSSH_5.6 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.1p1 Debian-6ubuntu2
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 'xxx.xxx.xxx.xxx' is known and matches the RSA host key.
debug1: Found key in /home/xxx/.ssh/known_hosts:11
(続く)

補足日時:2010/10/14 14:39
    • good
    • 0
この回答へのお礼

(続き)
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,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering public key: /home/xxx/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug1: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
debug1: Offering public key: /home/xxx/.ssh/id_dsa
debug1: Server accepts key: pkalg ssh-dss blen 433
debug1: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
debug1: No more authentication methods to try.
Permission denied (publickey,keyboard-interactive).
Couldn't read packet: Connection reset by peer

お礼日時:2010/10/14 14:41

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!