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/c08/trackback
List of Articles
번호 제목 글쓴이 날짜sort 조회 수
327 CentOS 6.5 에서 VirtualBox 4.3 설치후 VirtualBox 구동... ADMINPLAY 2014-02-14 7795
326 VirtualBox 4.3 Released – Install on RHEL/CentOS/Fedor... ADMINPLAY 2014-02-14 7272
325 ctime, mtime, atime 다른 점 설명 ADMINPLAY 2014-02-07 5953
324 ZFS 파일에 ACL 설정 ADMINPLAY 2014-02-03 5271
323 ll 명령시 날짜 전체가 보이도록 하기 ADMINPLAY 2014-01-02 5431
322 ModSecurity 로그파일의 사이즈가 너무 큰데 이를 날짜나 ... file ADMINPLAY 2013-12-29 6536
321 top 화면 내용중 load average와 PRI : priority(우선순위... ADMINPLAY 2013-12-24 5138
320 hddtemp와 mrtg를 이용한 하드디스크 온도 체크 file ADMINPLAY 2013-12-19 5450
319 tar 압축을 실수로 디렉토리 생성 안하고 풀었을때 대처법 ADMINPLAY 2013-09-22 5386
318 windows smartctl ADMINPLAY 2013-09-22 5273
317 HDD Guardian (a graphical user interface for smartctl) ADMINPLAY 2013-09-22 4951
316 리눅스 벤치마크 프로그램 목록 ADMINPLAY 2013-09-09 7562
315 Adaptec 컨트롤러 StorMan 에러 및 각종 확인 방법 ADMINPLAY 2013-06-12 8986
314 linux 커널 파라메터 수정 ADMINPLAY 2013-05-12 5554
313 특정 데몬의 메모리 점유율 확인하기 ADMINPLAY 2013-05-12 6131
312 make 정리 ADMINPLAY 2013-05-12 5264
311 What are the bandwidth requirements for running a BigB... ADMINPLAY 2013-05-06 5920
310 스트리밍 서비스 위한 각 회사 와우자,어도비,마이크로 ... ADMINPLAY 2013-05-06 9888
309 파일비교 명령어 diff 사용법 ADMINPLAY 2013-05-03 9646
308 웹서버 트래픽 시각화 logstalgia l2zeo 2013-05-03 6090

Copyright ADMINPLAY corp. All rights reserved.

abcXYZ, 세종대왕,1234

abcXYZ, 세종대왕,1234