less than 1 minute read

<TRAMP로 원격 파일을 로컬 파일처럼 편집> 글은 쓰면서 macOS에서 테스트했다. windows에서 똑같이 테스트해봤다. windows에서 bash를 emacs shell로 사용하고 있어서 ssh 명령어를 실행할 수 있다. 잘 되겠지?

exec(/usr/libexec/openssh/ssh-askpass): No such file or directory

패스워드를 입력해 로그인하는 사이트는 이런 메시지가 뜨며 접속이 안 된다. ssh 대신 plink를 사용해서 해결했다.

/ssh:root@example.com:

대신

/plink:root@example.com:

plink를 사용하면 된다.

그럼 패스워드 입력이 아니라 identity file을 로그인에 사용하는 사이트는 그냥 쓸 수 있겠지?

Tramp: Opening connection for dev using ssh...
Tramp: Sending command ‘ssh   -o ControlMaster=auto -o ControlPath='tramp.%C' -o ControlPersist=no -e none dev && exit || exit’
Tramp: Waiting for prompts from remote shell...failed
Tramp: Opening connection for dev using ssh...failed

안 된다.

/sshx:root@example.com:

ssh 대신 sshx를 사용하면 된다.

C-h v tramp-methods

("sshx"
  (tramp-login-program "ssh")
  (tramp-login-args
   (("-l" "%u")
    ("-p" "%p")
    ("%c")
    ("-e" "none")
    ("-t" "-t")
    ("%h")
    ("/bin/sh")))
  ...)

sshx도 ssh 프로그램을 사용한다. 넘기는 인자는 다르다. -t -t 옵션과 /bin/sh 명령을 추가했다. 강제로 tty를 할당하고 접속해서 sh 프로그램을 실행해서 문제를 해결한 것 같다.

패스워드 입력해야 하는 건 plink를 사용하고 identity file을 사용하는 건 sshx를 사용하면 된다.

C-x C-s C-x C-c