all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Chris Withers <chris@simplistix.co.uk>
Cc: "help-gnu-emacs@gnu.org >> Emacs Help" <help-gnu-emacs@gnu.org>,
	anselm.helbig+news2009@googlemail.com
Subject: Re: remote file editing over ssh with emacs 22.3.1 on Windows
Date: Tue, 26 May 2009 22:50:06 +0200	[thread overview]
Message-ID: <87ljojwpvl.fsf@gmx.de> (raw)
In-Reply-To: <4A1ABBE0.1080809@simplistix.co.uk> (Chris Withers's message of "Mon, 25 May 2009 16:40:16 +0100")

Chris Withers <chris@simplistix.co.uk> writes:

> I think I gave the example somewhere else in this thread, but I'd be
> looking to connect to something like:
>
> /cwithers:root@somehost.somedomain:/blah
>
> Why do I need cwithers? Because my local account is "Chris Withers" on
> the windows box where emacs lives, and my username on the remote
> machine is not always the same, it depends on the box (it can be
> chris, chrisw, cwithers, etc... I don't have control over that)

OK, I've checked the whole thread. I see your problem.

Anselm gave you several hints for configuration of ssh. Unfortunately,
you do not run ssh but putty.

Tramp supports a method called "plinkx" (since Tramp 2.1.10, I
believe). This is used to take putty session names, instead of host
names.

So for every remote host you want to access, you might create a putty
session, which includes the host and user names. Let's call such a putty
session "somehost", with host name "somehost.somedomain" and user name
"cwithers". Likely, you have done this already.

Than you can add two rules:

  (add-to-list 'tramp-default-proxies-alist
    '(nil "\\`root\\'" "/plinkx:%h:"))

  (add-to-list 'tramp-default-proxies-alist
    '("\\`localhost\\'" "\\`root\\'" nil))

The first rule means, whenever you want to be root on a remote host
(identified by a putty session name), Tramp first applies "plinkx" for
that session. The second rule makes an exception for the localhost, that
means "/sudo:localhost:" is performed directly.

Now you can use "/sudo:somehost:/blah", which means that first the
"plinkx" method is applied for putty session "somehost", and afterwards
"sudo" for user "root" is applied on host "somehost.somedomain", which
is configured in that session.

If you have other use cases (for example not to use multihop on some
hosts), you must trim the regexpes of the first rule.

(Note I haven't tested it, because I don't run MS Windows)

> One other wishlist item would be for tab complete or to be able to
> build a menu of the common hosts I want to connect to, typing
> "server1.simplistix.co.uk" is tiresome...

This is builtin: Tramp remembers all used host names (or putty session
names), and offers them next time in the minibuffer for completion.

> cheers,
>
> Chris

Best regards, Michael.




  reply	other threads:[~2009-05-26 20:50 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-07  8:48 remote file editing over ssh with emacs 22.3.1 on Windows Chris Withers
2009-05-07 18:27 ` Eli Zaretskii
2009-05-07 18:48   ` Ian Eure
2009-05-08 21:18     ` Chris Withers
2009-05-08 21:19       ` Ian Eure
2009-05-08 21:23         ` Chris Withers
2009-05-09  7:05       ` Eli Zaretskii
2009-05-09  8:49         ` Chris Withers
2009-05-09  9:27           ` Eli Zaretskii
2009-05-09 17:41             ` Chris Withers
2009-05-09 19:09               ` Eli Zaretskii
2009-05-10  8:37                 ` Chris Withers
2009-05-10 17:29                   ` Eli Zaretskii
2009-05-10 18:23                   ` Peter Dyballa
2009-05-16 16:57                     ` Chris Withers
     [not found]                 ` <mailman.6949.1241969740.31690.help-gnu-emacs@gnu.org>
2009-05-11 21:18                   ` Anselm Helbig
2009-05-16 16:59                     ` Chris Withers
2009-05-23 20:02                       ` Michael Albinus
2009-05-25 15:40                         ` Chris Withers
2009-05-26 20:50                           ` Michael Albinus [this message]
2009-05-30 12:26                             ` remote file editing over ssh with emacs 22.3.1 on Windows/Mac Chris Withers
2009-05-30 12:35                               ` Michael Albinus
2009-06-08 12:06                               ` remote editing of unix files over ssh with emacs 22.3.1 from Windows Chris Withers
2009-06-08 12:39                                 ` Michael Albinus
2009-06-08 12:58                                   ` Chris Withers
2009-06-08 13:08                                     ` Michael Albinus
2009-06-12 15:38                                       ` Chris Withers
2009-06-08 12:51                                 ` Peter Dyballa
     [not found]                     ` <mailman.7269.1242493182.31690.help-gnu-emacs@gnu.org>
2009-05-16 18:21                       ` remote file editing over ssh with emacs 22.3.1 on Windows Anselm Helbig
2009-05-25 15:44                         ` Chris Withers
2009-05-09 18:04           ` Peter Dyballa
2009-05-09 18:05             ` Chris Withers
2009-05-09 19:40               ` Peter Dyballa
2009-05-16 17:01                 ` Chris Withers
2009-05-16 18:26                   ` Peter Dyballa
     [not found]                 ` <mailman.7270.1242493264.31690.help-gnu-emacs@gnu.org>
2009-05-17  1:59                   ` Tim X
2009-05-25 15:50                     ` Chris Withers
     [not found]             ` <mailman.6908.1241895850.31690.help-gnu-emacs@gnu.org>
2009-05-10  8:43               ` Anselm Helbig
2009-05-10  8:50                 ` Richard Riley
2009-05-16 17:03                 ` Chris Withers
     [not found]                 ` <mailman.7271.1242493390.31690.help-gnu-emacs@gnu.org>
2009-05-16 17:54                   ` Anselm Helbig
2009-05-10  7:28           ` Reiner Steib

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ljojwpvl.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=anselm.helbig+news2009@googlemail.com \
    --cc=chris@simplistix.co.uk \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.