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: Mon, 29 Aug 2011 10:20:02 +0800 Message-ID: <87ipph9cx9.fsf@ericabrahamsen.net> References: <87liufcf8y.fsf@ericabrahamsen.net> <8762lha0gy.fsf@gmx.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1314584430 429 80.91.229.12 (29 Aug 2011 02:20:30 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 29 Aug 2011 02:20:30 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Aug 29 04:20:27 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 1QxrSc-0001IK-VQ for geh-help-gnu-emacs@m.gmane.org; Mon, 29 Aug 2011 04:20:27 +0200 Original-Received: from localhost ([::1]:52429 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QxrSc-0008P9-9x for geh-help-gnu-emacs@m.gmane.org; Sun, 28 Aug 2011 22:20:26 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:58676) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QxrSX-0008Ot-Rm for help-gnu-emacs@gnu.org; Sun, 28 Aug 2011 22:20:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QxrSW-0001ic-Uw for help-gnu-emacs@gnu.org; Sun, 28 Aug 2011 22:20:21 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:36112) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QxrSW-0001iS-PH for help-gnu-emacs@gnu.org; Sun, 28 Aug 2011 22:20:20 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QxrSV-0001Gp-4H for help-gnu-emacs@gnu.org; Mon, 29 Aug 2011 04:20:19 +0200 Original-Received: from 114.250.123.181 ([114.250.123.181]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 29 Aug 2011 04:20:19 +0200 Original-Received: from eric by 114.250.123.181 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 29 Aug 2011 04:20:19 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 35 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 114.250.123.181 User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/23.2 (gnu/linux) Cancel-Lock: sha1:N7Yt6EapugXd1y2Pajln5NPdbfg= 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:82084 Archived-At: On Mon, Aug 29 2011, Michael Albinus wrote: > Eric Abrahamsen writes: > > Hi, > >> The tramp manual explains how to access files as root on a remote >> server, with a two-jump system, but there doesn't seem to be any way to >> do this selectively: if I define a proxy, it seems to have me as root >> for all files on that server. >> >> Is there anyway to define two different methods for the same server, one >> that operates as my normal user and one that does a second jump to work >> as root? > > There is no need to apply sudo for a normal user, you could always > access via ssh like "/ssh:user@host:". This does not interfere with your > proxy settings for root. 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. 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? I tried defining another Host block ("sbl") in .ssh/config, where only the hostname and not the user were specified, but /sudo:sbl:/path just told me that sbl was a remote host and sudo couldn't be used for remote hosts… Thanks again, this at least got it working! Eric