Skip to content

rsync : protocol version mismatch -- is your shell clean?

조회 수 26191 추천 수 0 2009.05.17 10:05:07

Q) rsync 로 파일을 동기화를 하려고 할때 ssh 프로토콜을 사용하였을때 다음과 같은 에러가 나는 경우가 있다.

[root@TOM src]# rsync -avzP -e ssh root@xxx.xxxxxx.xxx:/home ./

root@xxx.xxx.xxx.xxx's password:
protocol version mismatch -- is your shell clean?
(see the rsync man page for an explanation)
rsync error: protocol incompatibility (code 2) at compat.c(64) [receiver=2.6.8]

 

A) 먼저, 구글 검색 결과를 먼저 보자.

is your shell clean

The "is your shell clean" message and the "protocol mismatch" message are usually caused by having some sort of program in your .cshrc, .profile, .bashrc or equivalent file that writes a message every time you connect using a remote-shell program (such as ssh or rsh). Data written in this way corrupts the rsync data stream. rsync detects this at startup and produces those error messages. However, if you are using rsync-daemon syntax (host::path or rsync://) without using a remote-shell program (no --rsh or -e option), there is not remote-shell program involved, and the problem is probably caused by an error on the daemon side (so check the daemon logs).

A good way to test if your remote-shell connection is clean is to try something like this (use ssh or rsh, as appropriate):
ssh remotesystem /bin/true > test.dat

That should create a file called test.dat with nothing in it. If test.dat is not of zero length then your shell is not clean. Look at the contents of test.dat to see what was sent. Look at all the startup files on remotesystem to try and find the problem.

 

간단하게 말하면......

ssh 로긴시에 배너나 특정 프로그램의 출력 등으로 인해 커맨드가 떨어지기 전에 다른 문구가 나오면 not clean 으로 인식한다는 이야기다. !

shell clean 여부를 테스트 하기 위해서는 다음의 커맨드를 사용하면 된다.

[root@TOM src]# ssh xxx.xxx.xxx.xxx /bin/true > test.dat

위의 커맨드를 사용하고 난 후

[root@TOM src]# ls -al test.dat

로 파일을 보았을 때 파일 사이즈가 0 이면 clean 이고 0 이 아니면 not clean 이다 !

 

~/.profile ~/.bashrc ~/.cshrc 나 배너 파일등을 수정하여 위의 테스트에서 파일 사이즈가 0 이 나오도록 수정해 주면 정상적으로 동기화가 가능하다.

 

profile

일요일은 짜빠게뤼~ 먹는날~^^

엮인글 :
http://adminplay.com/1687/e20/trackback
List of Articles
번호 제목 글쓴이 날짜 조회 수sort
67 클라이언트가 ssh접속시 서버의 RSA키값 변경으로 인한 접... ADMINPLAY 2016-05-20 8869
66 CentOS 자동로그인 설정 ADMINPLAY 2014-04-14 8833
65 allowScriptAccess 설정 l2zeo 2012-05-05 8425
64 HTML5 멀티미디어 태그 - <video>,<audio>,<embed> ADMINPLAY 2012-05-02 8317
63 Zabbix 웹서비스 모니터링 ADMINPLAY 2014-07-07 8267
62 SCM - 캐시 서버 구축 (Squid in Linux) ADMINPLAY 2014-04-27 8237
61 <video>의 속성과 메소드 ADMINPLAY 2012-10-29 8226
60 cacti plugin thold 설치 ADMINPLAY 2014-07-07 8092
59 proxy 서버 통해서 외부문서 불러오기 curl ADMINPLAY 2013-02-20 8087
58 CentOS 6.5 + Python2.7 + MySQL_Python-1.2.3 ADMINPLAY 2014-03-28 7950
57 ubuntu 부팅시 서비스 자동실행 및 실행방지 ADMINPLAY 2013-04-16 7902
56 python mysql connector 설치 및 SQLAachemy 연동 ADMINPLAY 2014-03-27 7882
55 sakai 2.7.0 source installation in ubuntu 10.04.1 file ADMINPLAY 2012-10-31 7882
54 CentOS Linux Remote Desktop 에서 로그인 화면보기 ADMINPLAY 2014-04-14 7808
53 CentOS 6.5 에서 VirtualBox 4.3 설치후 VirtualBox 구동... ADMINPLAY 2014-02-14 7795
52 원격데스크톱(RDP) 클라이언트 접속기록(Log) 삭제하기 file ADMINPLAY 2014-07-14 7621
51 스퀴드(squid) 로그 로테이트 방법 ADMINPLAY 2012-05-18 7609
50 리눅스 벤치마크 프로그램 목록 ADMINPLAY 2013-09-09 7562
49 SVN 클라이언트 명령어 ADMINPLAY 2014-03-18 7438
48 VirtualBox 4.3 Released – Install on RHEL/CentOS/Fedor... ADMINPLAY 2014-02-14 7272

Copyright ADMINPLAY corp. All rights reserved.

abcXYZ, 세종대왕,1234

abcXYZ, 세종대왕,1234