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/990/trackback
List of Articles
번호 제목 글쓴이 날짜 조회 수sort
307 grep 옵션, egrep 옵션 차이점 ADMINPLAY 2010-02-17 26266
306 리눅스 파일/디렉토리 개수 알기 ADMINPLAY 2010-05-19 26207
» rsync : protocol version mismatch -- is your shell clean? ADMINPLAY 2009-05-17 26191
304 .vimrc 설정 설정, 색상 (VI 설정 색상) ADMINPLAY 2009-03-21 26177
303 리눅스에서 윈도우 공유폴더 접근하기. samba ADMINPLAY 2011-07-12 25881
302 장비를 복제해서 옮겼을 경우 네트워크가 eth0_rename 되... ADMINPLAY 2012-01-31 25796
301 linux - cp 덮어쓰기옵션 ADMINPLAY 2012-02-24 25692
300 CentOS ffmpeg yum install ADMINPLAY 2012-02-07 25577
299 리눅스 TIP ADMINPLAY 2009-03-09 25525
298 리눅스 - tar 압축 사용법 ADMINPLAY 2010-02-20 25482
297 iSCSI 설정하기 ADMINPLAY 2011-04-24 25470
296 리눅스 파일 복구 명령 debugfs ADMINPLAY 2009-06-24 25454
295 MS-DOS 배치파일 문법 ADMINPLAY 2012-01-16 25390
294 백 그라운드, 포그라운드 전환 ADMINPLAY 2009-06-04 25183
293 CentOS 5.4 Samba 서버 <-> 윈도우7에서 접근 문제 시스템관리짱 2011-03-04 25160
292 [FreeBSD]CPU, 메모리, HDD확인 및 네트워크 설정 ADMINPLAY 2012-01-17 25081
291 리눅스 시스템 관리자를 위한 즐겨찾기 ADMINPLAY 2009-05-22 24981
290 netstat 의 Send-Q, Recv-Q의 의미 ADMINPLAY 2009-02-09 24976
289 오라클11g 설치 (in centOS 5.1) ADMINPLAY 2010-04-28 24943
288 tar.gz 특정 디렉토리에 압축풀기 ADMINPLAY 2009-06-29 24928

Copyright ADMINPLAY corp. All rights reserved.

abcXYZ, 세종대왕,1234

abcXYZ, 세종대왕,1234