From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.help Subject: Re: tramp sudo or not sudo on remote server Date: Tue, 30 Aug 2011 10:36:15 +0800 Message-ID: <87r543vd5s.fsf@ericabrahamsen.net> References: <87liufcf8y.fsf@ericabrahamsen.net> <8762lha0gy.fsf@gmx.de> <87ipph9cx9.fsf@ericabrahamsen.net> <87bov882zz.fsf@gmx.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1314671827 25117 80.91.229.12 (30 Aug 2011 02:37:07 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 30 Aug 2011 02:37:07 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Aug 30 04:37:02 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QyECC-0005rI-Ev for geh-help-gnu-emacs@m.gmane.org; Tue, 30 Aug 2011 04:37:00 +0200 Original-Received: from localhost ([::1]:39014 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QyECB-0002Zj-N0 for geh-help-gnu-emacs@m.gmane.org; Mon, 29 Aug 2011 22:36:59 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:40460) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QyEC8-0002Ze-4z for help-gnu-emacs@gnu.org; Mon, 29 Aug 2011 22:36:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QyEC7-0007Oa-2d for help-gnu-emacs@gnu.org; Mon, 29 Aug 2011 22:36:56 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:60353) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QyEC6-0007OW-TG for help-gnu-emacs@gnu.org; Mon, 29 Aug 2011 22:36:55 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QyEC4-0005ps-Su for help-gnu-emacs@gnu.org; Tue, 30 Aug 2011 04:36:52 +0200 Original-Received: from 221.216.160.68 ([221.216.160.68]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 30 Aug 2011 04:36:52 +0200 Original-Received: from eric by 221.216.160.68 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 30 Aug 2011 04:36:52 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 40 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 221.216.160.68 User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/23.2 (gnu/linux) Cancel-Lock: sha1:2y5nQRn6vYHTAGuhSXcFet5bq0c= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:82091 Archived-At: On Tue, Aug 30 2011, Michael Albinus wrote: > Eric Abrahamsen writes: > >> Sorry, I think I confused myself by using .ssh/config to define >> Host shortcuts for servers, such that "/bl:/path" goes to a certain host as a >> certain user. > > If you don't specifiy a method, likely (the default method) scp is > used. That should work fine. > > For proxy hops, you couldn't use scp, because it is an external > method. Hops must always be an internal method, like ssh. > > So the following shall work: > > (add-to-list 'tramp-default-proxies-alist > '("\\`bl\\'" "\\`root\\'" "/ssh:bl:")) > > With this, it should be possible to access "/sudo:bl:/path" as root. Great! That works perfectly (and helps me make sense of what's actually going on in these proxy sexps). > >> Presumably I wouldn't be able to use this trick if I want >> to use switch between my regular user and sudo. There are a couple of >> awfully long host names, though -- are there any other shortcuts I can >> use? > > See the Tramp manual, section "Frequently Asked Questions". Thanks, actually all I was asking was what you answered above -- how to continue using my .ssh/config shortcuts. >> Thanks again, this at least got it working! >> >> Eric > > Best regards, Michael.