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: Using tramp to connect to a remote emacs session Date: Fri, 04 Sep 2009 09:03:17 +0200 Message-ID: References: <4A9EFA5A.1030002@gmail.com> <4A9FE866.8040805@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1252047849 29061 80.91.229.12 (4 Sep 2009 07:04:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 4 Sep 2009 07:04:09 +0000 (UTC) Cc: Emacs mailing list To: Suvayu Ali Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Sep 04 09:04:01 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 1MjSq0-0007eP-B6 for geh-help-gnu-emacs@m.gmane.org; Fri, 04 Sep 2009 09:04:01 +0200 Original-Received: from localhost ([127.0.0.1]:52445 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MjSpz-0001Bo-Li for geh-help-gnu-emacs@m.gmane.org; Fri, 04 Sep 2009 03:03:59 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MjSpZ-000181-E7 for help-gnu-emacs@gnu.org; Fri, 04 Sep 2009 03:03:33 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MjSpV-00013y-Ot for help-gnu-emacs@gnu.org; Fri, 04 Sep 2009 03:03:33 -0400 Original-Received: from [199.232.76.173] (port=49700 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MjSpV-00013t-NY for help-gnu-emacs@gnu.org; Fri, 04 Sep 2009 03:03:29 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]:22000) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MjSpU-0005uj-W0 for help-gnu-emacs@gnu.org; Fri, 04 Sep 2009 03:03:29 -0400 Original-Received: from mailrelay2.alcatel.de ([194.113.59.96]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MjSpQ-00077R-SR for help-gnu-emacs@gnu.org; Fri, 04 Sep 2009 03:03:25 -0400 Original-Received: from destgsu0048.stgl.sel.alcatel.de (destgsu0048.de.alcatel-lucent.com [149.204.242.4]) by mailrelay2.alcatel.de (8.13.8/8.13.8/ICT) with ESMTP id n8473J8b031887; Fri, 4 Sep 2009 09:03:19 +0200 Original-Received: from slbhn1.alcatel.de (slbhn1.de.alcatel-lucent.com [149.204.90.35]) by destgsu0048.stgl.sel.alcatel.de (8.12.3/8.12.3) with ESMTP id n8473IY4025657; Fri, 4 Sep 2009 09:03:18 +0200 (MEST) In-Reply-To: <4A9FE866.8040805@gmail.com> (Suvayu Ali's message of "Thu, 3 Sep 2009 18:01:42 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-Alcanet-virus-scanned: n8473IY4025657 at destgsu0048.stgl.sel.alcatel.de X-Scanned-By: MIMEDefang 2.57 on 149.204.45.73 X-Detected-Operating-System: by mx20.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 2) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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:67847 Archived-At: Suvayu Ali writes: > Hi Michael, Hi, >> --- >> * How can I use TRAMP to connect to a remote GNU Emacs session? >> >> You can configure Emacs Client doing this. On the remote host, >> you start the Emacs Server: >> >> (require 'server) >> (setq server-host (system-name) >> server-use-tcp t) >> (server-start) >> >> Make sure, that the result of `(system-name)' can be resolved on >> your local host; otherwise you might use a hard coded IP address. >> >> The resulting file `~/.emacs.d/server/server' must be copied to >> your local host, at the same location. You can call then the >> Emacs Client from the command line: >> >> emacsclient /ssh:user@host:/file/to/edit >> >> `user' and `host' shall be related to your local host. > > Correct me if I go wrong, when I issue that command emacsclient tells > the remote server to connect with the localhost over tramp. It > determines where the remote server is from the server file. Yes. > My problem is my ISP at the local machine doesn't allow me to login to > it from outside. In other words I probably don't have a static ip. So > when I issue the command I get, > >> $ emacsclient /ssh:user@local.host:~/file >> emacsclient: connect: Connection refused >> emacsclient: connected to remote socket at xxx.xx.xxx.xx >> Waiting for Emacs... >> >> *ERROR*: Process died So at least emacsclient was able to connect your remote server. Good. > And on the remote machine I get the following in the *Messages* buffer, > >> Tramp: Opening connection for user@local.host using ssh... >> Tramp: Waiting 60s for local shell to come up... >> Tramp: Sending command `ssh local.host -l user -q -e none && exit || exit' >> Tramp: Waiting for prompts from remote shell >> File error: Process died That I do not catch. Are the messages exactly as you have written, or did you exchange the real user and host name by "user" and "local.host"? Note, that "user" shall be the user name you run your local host, and "local.host" must be an FQDN of your host, or an IP address. > So to summarize my problem is I can only connect one way, local.host to > remote machine, and hence tramp fails to work. Does this mean the only > way I will get this working is to get my ISP to give me a static ip? You have mentioned two different explanations. Either your ISP does not allow you to login from the outside. Then we could stop. But usually, they don't forbid it. If you have a dynamic IP address (the other possiblitiy), you could run emacsclient /ssh:user@1.2.3.4:/file/to/edit "1.2.3.4" would be the IP address you are currently using. Because this changes day by day, you might evaluate it every time in a script, starting emacsclient. The more simple solution is to register your local machine with dynamic DNS. Let's say you have registered it at http://www.dyndns.com/, under the name "suvayu.homelinux.org" (just as example). Then you could connect via emacsclient /ssh:user@suvayu.homelinux.org:/file/to/edit Another trap you could enter is your router configuration at home. You must allow incoming connections at port 22 (for ssh), and it must be forwarded to your local host. > Thanks for the help so far Michael. Much appreciated. Best regards, Michael.