Term Images for "Emacs, Windows, and SSH"

Emacs, Windows, and SSH

in

One of the biggest bees in my bonnet with Emacs on win32 was the fact that I couldn't really get cygwin ssh to play nice with it. It would always complain about an inappropriate ioctl device or some such.

The fix? Use Plink, part of the PuTTY suite (download download plink here).

Here is a little function to make it go. If you need to log in with a different user name, just use the user@ syntax.

(require 'telnet)

(defun ssh (host password)
  "Open a network login connection to host named HOST (a string).
   Communication with HOST is recorded in a buffer `*ssh*'.
   Normally input is edited in Emacs and sent a line at a time."
  (interactive "sOpen ssh connection to host: \nsPassword:\n")
  (let* ((comint-delimiter-argument-list '(?\  ?\t))
         (name "ssh")
         (buffer (get-buffer "*ssh*"))
         process)
    (setq telnet-new-line (char-to-string 13))

    (if (and buffer (get-buffer-process buffer))
        (pop-to-buffer buffer)
		(pop-to-buffer (make-comint name "c:/program files/putty/plink.exe" nil "-ssh" host "-pw" password))
		(setq process (get-buffer-process (current-buffer)))
		(set-process-filter process 'telnet-initial-filter)
		(accept-process-output process)
		(telnet-mode)
		(setq comint-input-sender 'telnet-simple-send)
		(setq telnet-count telnet-initial-count))))
Your rating: None

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
The fucking spammers are ruining the internets. Sadly I need to make sure you are human.
5 + 6 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.