LoginSignup
0
1

More than 5 years have passed since last update.

Ubuntuでrsync(lsync)を利用する際のエラー

Posted at

Ubuntuでlsyncやrsyncを利用する際に吐かれたエラーのメモ。
なぜこうもわかりにくいのか。

エラーと原因と対策

protocol version mismatch

エラー

protocol version mismatch -- is your shell clean?
(see the rsync man page for an explanation)
rsync error: protocol incompatibility (code 2) at compat.c(176) [sender=3.1.1]
Sat Aug 25 16:14:26 2018 Error: Failure on startup of "/var/keys/".

原因

  • rootで作業しようとしてた
    • ubuntuはrootログイン禁止なのでコケていた

対策

  • ubuntuユーザで作業するよう修正

Host key verification failed.

エラー

Host key verification failed.
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(226) [sender=3.1.1]
Sat Aug 25 16:54:01 2018 Error: Temporary or permanent failure on startup of "/var/keys/". Terminating since "insist" is not set.

原因

  • known_hostに接続対象のサーバの設定が足りていなかった

対策

  • known_hostを無視するため-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=noをオプションに追加。

lsync設定ファイルの例:

...

sync {
    default.rsync,
    source="/tmp/foo",
    target="ubuntu@target_server:/tmp/foo",
    delete=false,
    rsync = {
        rsh = "/usr/bin/ssh -i /home/ubuntu/.ssh/pkey -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
    }
}

環境

  • ubuntu: 16.4 LTS
    • Linux ip-10-1-0-5 4.4.0-1057-aws #66-Ubuntu SMP Thu May 3 12:49:47 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
  • rsync: version 3.1.1 protocol version 31
  • lsync: 2.1.5
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1