###前提・実現したいこと
さくらVPSにて契約中のVPS(2台)をスイッチにてLAN接続しscpにてファイル転送を行いたいのですが、うまく転送しません。
解決方法をご存じの方おられましたら、想定される原因・解決方法を教えていただけると幸いです。
###発生している問題・エラーメッセージ
scp -vで状況を辿ると以下のような状態。
必ず毎回同じ場所でタイムアウト。
サーバーAからBへの転送は可能だが、BからAの場合かならずタイムアウトとなる。
別件となるのか、根本は同じ原因かもしれませんが・・・
サーバーAがWebサービスを実行させているサーバー、サーバーBがDBサーバとして構築しているのですが、データベースへのアクセスも、AからBへクエリを投げていますが、返ってこないため正常にWebサービスが動作していない状況です。
サーバーA内で全て完結させると動作します。
[%%USER%%@SERVER ~]$ sudo scp -v -P %%PORT%% -i .ssh/%%KEY%% 送信ファイル %%USER%%@192.168.0.1:./ [sudo] %%USER%% のパスワード: Executing: program /usr/bin/ssh host 192.168.0.1, user %%USER%%, command scp -v -t ./ OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017 debug1: Reading configuration data /root/.ssh/config debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 58: Applying options for * debug1: Connecting to 192.168.0.1 [192.168.0.1] port %%PORT%%. debug1: Connection established. debug1: permanently_set_uid: 0/0 debug1: key_load_public: No such file or directory debug1: identity file .ssh/%%KEY%% type -1 debug1: key_load_public: No such file or directory debug1: identity file .ssh/%%KEY%%-cert type -1 debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_7.4 debug1: Remote protocol version 2.0, remote software version OpenSSH_7.4 debug1: match: OpenSSH_7.4 pat OpenSSH* compat 0x04000000 debug1: Authenticating to 192.168.0.1:%%PORT%% as '%%USER%%' debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: algorithm: curve25519-sha256 debug1: kex: host key algorithm: ecdsa-sha2-nistp256 debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none debug1: kex: curve25519-sha256 need=64 dh_need=64 debug1: kex: curve25519-sha256 need=64 dh_need=64 debug1: expecting SSH2_MSG_KEX_ECDH_REPLY Connection to 192.168.0.1 port %%PORT%% timed out
###追記 2017.12.27
eth0のインターネット側からは転送可能です。
ご指摘いただいた、/var/log/secure にはeth1の場合サーバーAにログがありません。
これもeth0のインターネット側の場合接続ログが残っています。
firewalldの設定ですが、AB共通で下記のような設定となっております。
LAN (active)
target: default
icmp-block-inversion: no
interfaces: eth1
sources:
services: ssh
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
public (active)
target: default
icmp-block-inversion: no
interfaces: eth0
sources:
services: dhcpv6-client ssh http
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
###補足情報(言語/FW/ツール等のバージョンなど)
さくらVPSにて契約中のVPS(2台)をスイッチにてLAN接続し、
サーバーA eth1(192.168.0.1)とサーバーB eth1(192.168.0.2)として設定、接続済み。
pingは通り、ip route や routelにて設定確認済み。
OSはCentOS7、LAMPのみ導入
本日、yum update済み。
firewalldはzone「LAN」を新規作成し、interfaceにeth1、serviceにsshを設定しています。