BTW, this is the plink-ssh of which I spoke: connect using plink in a
telnet-mode buffer.                           HTH, [EMAIL PROTECTED]

-------- Original Message --------
Subject: plink-ssh, was: plink in *shell*
Date: Fri, 02 Mar 2001 15:28:51 -0500
From: [EMAIL PROTECTED]
To: Bill Pringlemeir <[EMAIL PROTECTED]>

Bill Pringlemeir <[EMAIL PROTECTED]> 02 Mar 2001 10:59:40
> ;; SSH to host.
> (setq plink-program "plink")
> (require 'telnet)
> (defun plink-ssh (host)
>   "Open a network login connection. See plink."
>   (interactive "sOpen ssh connection to host: ")
>   (plink host "-ssh"))

> ;; Telnet to host.
> (defun plink (host &optional ssh-string)
>   "Open a network login connection to host named HOST (a string).
> Communication with HOST is recorded in a buffer `*plink-HOST*'.
> Normally input is edited in Emacs and sent a line at a time."
>   (interactive "sOpen ssh connection to host: ")
>   (require 'shell)
>   (let ((name (concat "plink-" host))
>         (password (comint-read-noecho "password: " t)))
>     (pop-to-buffer 
>      (make-comint name 
>         plink-program nil ssh-string host "-pw" password))
>      (set-process-filter (get-process name) 'telnet-initial-filter)
>     (telnet-mode)
>     (accept-process-output  (get-buffer-process (current-buffer)))
>     (send-string (get-buffer-process (current-buffer))
>                  "stty echo\n")
>     (setq telnet-count -16)))

Works for me! Just some documentation:

* Users should

  M-x plink-ssh

  which works, not

  M-x plink

  which does not--at least, for me: I get the error

> wrong-type-argument stringp nil

* The user is prompted

> Open ssh connection to host:

  to which the user should provide "user@host" (otherwise, the process
  will just hang until C-g).

There is also (again, on my box) one minor bug: if someone knows how
to fix this, I'd appreciate being told.

* At the end of login, I get a second 

> Password: 

  prompt, with point in the minibuffer. I can C-g out of it with no
  ill effect, but if there's a way to fix this, I'd like to know.

Thanks for the code! I encourage you to submit this to the Emacs Lisp
Archive:

http://www.cis.ohio-state.edu/emacs-lisp/

[EMAIL PROTECTED]

Reply via email to