From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.help Subject: Re: remote file editing over ssh with emacs 22.3.1 on Windows Date: Tue, 26 May 2009 22:50:06 +0200 Message-ID: <87ljojwpvl.fsf@gmx.de> References: <4A02A04F.6010307@simplistix.co.uk> <83hbzwdazt.fsf@gnu.org> <0F841C30-5A42-4F96-95CE-49FA51BDBDB6@digg.com> <4A04A18F.2020404@simplistix.co.uk> <833abedact.fsf@gnu.org> <4A0543A3.9000007@simplistix.co.uk> <83y6t6bp8l.fsf@gnu.org> <4A05C052.10607@simplistix.co.uk> <83bpq2ytya.fsf@gnu.org> <87fxfbibjr.wl%anselm.helbig+news2009@googlemail.com> <4A0EF0FC.2020608@simplistix.co.uk> <87d49zy4dl.fsf@gmx.de> <4A1ABBE0.1080809@simplistix.co.uk> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1243371045 11142 80.91.229.12 (26 May 2009 20:50:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 26 May 2009 20:50:45 +0000 (UTC) Cc: "help-gnu-emacs@gnu.org >> Emacs Help" , anselm.helbig+news2009@googlemail.com To: Chris Withers Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue May 26 22:50:42 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1M93bc-0003PK-By for geh-help-gnu-emacs@m.gmane.org; Tue, 26 May 2009 22:50:41 +0200 Original-Received: from localhost ([127.0.0.1]:49390 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M93bb-0002tq-MN for geh-help-gnu-emacs@m.gmane.org; Tue, 26 May 2009 16:50:39 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M93bG-0002tX-H9 for help-gnu-emacs@gnu.org; Tue, 26 May 2009 16:50:18 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M93bC-0002rh-2j for help-gnu-emacs@gnu.org; Tue, 26 May 2009 16:50:18 -0400 Original-Received: from [199.232.76.173] (port=56252 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M93bB-0002rZ-TY for help-gnu-emacs@gnu.org; Tue, 26 May 2009 16:50:13 -0400 Original-Received: from mail.gmx.net ([213.165.64.20]:59342) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1M93bB-0000w5-4Y for help-gnu-emacs@gnu.org; Tue, 26 May 2009 16:50:13 -0400 Original-Received: (qmail invoked by alias); 26 May 2009 20:50:08 -0000 Original-Received: from brln-4db97343.pool.einsundeins.de (EHLO arthur.local) [77.185.115.67] by mail.gmx.net (mp016) with SMTP; 26 May 2009 22:50:08 +0200 X-Authenticated: #3708877 X-Provags-ID: V01U2FsdGVkX1803kRE3/U02qMgXWpEQEPOiQcrEoaYPBJrg+GQzr XI2uXq3USd+eh2 In-Reply-To: <4A1ABBE0.1080809@simplistix.co.uk> (Chris Withers's message of "Mon, 25 May 2009 16:40:16 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.94 (gnu/linux) X-Y-GMX-Trusted: 0 X-FuHaFi: 0.6 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:64745 Archived-At: Chris Withers 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.