From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Suvayu Ali Newsgroups: gmane.emacs.help Subject: Re: Using tramp to connect to a remote emacs session Date: Fri, 04 Sep 2009 04:05:09 -0700 Message-ID: <4AA0F465.7030504@gmail.com> References: <4A9EFA5A.1030002@gmail.com> <4A9FE866.8040805@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1252062398 8365 80.91.229.12 (4 Sep 2009 11:06:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 4 Sep 2009 11:06:38 +0000 (UTC) Cc: Emacs mailing list To: Michael Albinus Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Sep 04 13:06:31 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 1MjWch-0006xn-HU for geh-help-gnu-emacs@m.gmane.org; Fri, 04 Sep 2009 13:06:31 +0200 Original-Received: from localhost ([127.0.0.1]:44765 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MjWch-0004dx-0B for geh-help-gnu-emacs@m.gmane.org; Fri, 04 Sep 2009 07:06:31 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MjWbW-00046B-LQ for help-gnu-emacs@gnu.org; Fri, 04 Sep 2009 07:05:18 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MjWbR-00041F-NA for help-gnu-emacs@gnu.org; Fri, 04 Sep 2009 07:05:17 -0400 Original-Received: from [199.232.76.173] (port=59707 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MjWbR-000417-Ck for help-gnu-emacs@gnu.org; Fri, 04 Sep 2009 07:05:13 -0400 Original-Received: from mail-px0-f197.google.com ([209.85.216.197]:42044) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MjWbQ-0006eH-MK for help-gnu-emacs@gnu.org; Fri, 04 Sep 2009 07:05:13 -0400 Original-Received: by pxi35 with SMTP id 35so659620pxi.12 for ; Fri, 04 Sep 2009 04:05:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=FklGJHMW6kSvjkTxzn8pIFW4Npd/uwm0erRQriicbEo=; b=EQ5hxm9Fopv+zb+SG0ymGdYm8Ss7gEzDu6JL/Z7RCCn0vhk9dOnkP6I2h+/8oaCIT9 DE2yUhULsnGKjUIoohnads25XDef5o5p3/3TPr5wk3oMtJTTgKksKPRq4b3WRFBVH8IW UrVXfLccsQ0Yf6WO7veUrET9fr3vjxKbdWVd4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=in6m0skWIdXnFv1u/uDw337JjUS6OQHvHJGVS1lrERZEsTmWEfUF3MKQcuOhQRwkio oUPtEHi+ZMfRW94aCR8PjLSuxe+kd326kYKYoA+vugFNh3EEKVTIsf1Q0WAPTuRiiw+z +ctmCsjeEnEfrw1QmhzZ34ceSPIWy2/KiAwvE= Original-Received: by 10.115.133.7 with SMTP id k7mr9839437wan.96.1252062311517; Fri, 04 Sep 2009 04:05:11 -0700 (PDT) Original-Received: from bhishma.kuru (d66-183-43-146.bchsia.telus.net [66.183.43.146]) by mx.google.com with ESMTPS id 22sm133013pzk.2.2009.09.04.04.05.10 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 04 Sep 2009 04:05:10 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090814 Fedora/3.0-2.6.b3.fc11 Lightning/1.0pre Thunderbird/3.0b3 In-Reply-To: X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:67861 Archived-At: Hi Michael, On Friday 04 September 2009 12:03 AM, Michael Albinus wrote: > Suvayu Ali writes: > >> 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"? > My lab is a bit paranoid about security so I edited out the specifics and put in generic names. :) > 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. > The host name for my localhost is limited to the local network. The Siemens router from my ISP (Telus) probably implements some kind of NAT (I'm not sure). So the outgoing connection worked, whereas the incoming connection failed. >> 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. > I don't have a static IP, moreover from the outside I can only see my ISP's servers not my home machine. Hence I can't login from the outside. > 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 > This is very interesting. I had no idea such a service existed! I will definitely look into this. > 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. > I can login to my router's admin interface, so that should not be difficult to setup. Thanks for your patience. :) -- Suvayu Open source is the future. It sets us free.