all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Passing Username for M-x rsh
@ 2006-03-15 10:00 Annamalai Gurusami
  0 siblings, 0 replies; 2+ messages in thread
From: Annamalai Gurusami @ 2006-03-15 10:00 UTC (permalink / raw)


Hi All,

When I use M-x rsh to login to a remote host, how can I specify the
username?  When I do M-x rsh, I am prompted for a hostname; Once I
provide the hostname, I am then prompted for a password, without being
asked for a username.  

Currently, I provide a wrong password, and then I get prompted for a
username.  This is cumbersome.  Any help?

Rgds,
anna

-- 

What you spend years building may be destroyed overnight.  
Build anyway.     http://www.paradoxicalcommandments.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Passing Username for M-x rsh
       [not found] <mailman.49.1142416858.9686.help-gnu-emacs@gnu.org>
@ 2006-03-15 10:52 ` Katsumi Yamaoka
  0 siblings, 0 replies; 2+ messages in thread
From: Katsumi Yamaoka @ 2006-03-15 10:52 UTC (permalink / raw)


>>>>> In <mailman.49.1142416858.9686.help-gnu-emacs@gnu.org>
>>>>>	Annamalai Gurusami wrote:

> When I use M-x rsh to login to a remote host, how can I specify the
> username?  When I do M-x rsh, I am prompted for a hostname; Once I
> provide the hostname, I am then prompted for a password, without being
> asked for a username.

> Currently, I provide a wrong password, and then I get prompted for a
> username.  This is cumbersome.  Any help?

You can override the rsh command like the following (it can be
added to the ~/.emacs file):

(defadvice rsh (around prompt-for-username (host &optional user) activate)
  "If given a prefix argument, prompt for a user name."
  (interactive "sOpen rsh connection to host: \nP")
  (if (and user
	   (interactive-p))
      (setq user
	    (let ((minibuffer-setup-hook '(beginning-of-line)))
	      (read-string "User name: "
			   (user-login-name) nil (user-login-name)))))
  (require 'shell)
  (let ((name (concat "rsh-" host )))
    (pop-to-buffer
     (if user
	 (make-comint name remote-shell-program nil host "-l" user)
       (make-comint name remote-shell-program nil host)))
    (set-process-filter (get-process name) 'telnet-initial-filter)
    (telnet-mode)
    (setq telnet-count -16)))

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-03-15 10:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-15 10:00 Passing Username for M-x rsh Annamalai Gurusami
     [not found] <mailman.49.1142416858.9686.help-gnu-emacs@gnu.org>
2006-03-15 10:52 ` Katsumi Yamaoka

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.