From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bob Proulx Newsgroups: gmane.emacs.help Subject: Re: EShell tips on SSH? Date: Tue, 15 Jan 2013 00:32:34 -0700 Message-ID: <20130115073234.GA29218@hysteria.proulx.com> References: <6faf1f5e-de18-4c8f-b5a8-325b67790f6c@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1358235162 7170 80.91.229.3 (15 Jan 2013 07:32:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 15 Jan 2013 07:32:42 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Wenshan Ren Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jan 15 08:33:00 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Tv111-0007VT-Bg for geh-help-gnu-emacs@m.gmane.org; Tue, 15 Jan 2013 08:32:59 +0100 Original-Received: from localhost ([::1]:36981 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tv10k-0001JE-Qj for geh-help-gnu-emacs@m.gmane.org; Tue, 15 Jan 2013 02:32:42 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:59124) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tv10e-0001J0-RD for help-gnu-emacs@gnu.org; Tue, 15 Jan 2013 02:32:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tv10d-0001Oj-OT for help-gnu-emacs@gnu.org; Tue, 15 Jan 2013 02:32:36 -0500 Original-Received: from joseki.proulx.com ([216.17.153.58]:41710) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tv10d-0001Oa-Gq for help-gnu-emacs@gnu.org; Tue, 15 Jan 2013 02:32:35 -0500 Original-Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id 9A42E211D5; Tue, 15 Jan 2013 00:32:34 -0700 (MST) Original-Received: by hysteria.proulx.com (Postfix, from userid 1000) id 5FDC22DCDC; Tue, 15 Jan 2013 00:32:34 -0700 (MST) Mail-Followup-To: Wenshan Ren , help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: <6faf1f5e-de18-4c8f-b5a8-325b67790f6c@googlegroups.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 216.17.153.58 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:88627 Archived-At: Wenshan Ren wrote: > I manage a few VMs via SSH. As an Emacs user, I'm considering to get > everything done without leaving Emacs. Sure. > So far I've met two problems: > > 1. ssh -A > ssh -A does agent forwarding, but I can't find the EShell > equivalent by searching the Emacs Info. How are you invoking ssh? My first thought is the use of the emacs "tramp" module. This is quite well documented and very useful. If you are using tramp please say so. If you are not using tramp then look up the documentation and read up on tramp. You will like it. > How do you achieve the same effect of ssh -A in Emacs? I don't recommend to forward your agent. If you do forward your agent only forward it to systems that you trust. Because root on the remote system can make use of your forwarded agent. If you do want to forward your agent anyway I would set it up to do so in your ssh configuration file. That would avoid the need for a command line option. Then when Emacs and Tramp use ssh it will get the agent forwarding because of the ssh configuration. Something like this usually in your $HOME/.ssh/config file: Host foo.example.com ForwardAgent yes If you do this then your ssh-agent will be forwarded through tramp shell and tramp eshell sessions. I tested this just now and it worked okay for me. > 2. cd / > After `cd /ssh:username@host', `cd /' will change directory to / > of my local machine. Is there any way to make EShell behave like > a ordinary bash sshed to a remote machine? I think the idea for "cd" in eshell is that "/ssh:username@host" is just a directory path like any other. Therefore "cd /" will also be a path like any other. It isn't special. It isn't a chroot. Even if you use "shell" (instead of "eshell") you are still inside emacs. I note that with shell doing "cd /" will stay on the remote machine and won't crawl out of the facade. I am not arguing against eshell. But just sayhing that shell implements this feature as you wish it. If you use shell then you will be ssh'd into the machine and cd / will take you to the root of the remote machine as you desire. Bob