9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Russ Cox" <rsc@plan9.bell-labs.com>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] sshnet usage?
Date: Wed, 11 Dec 2002 10:49:41 -0500	[thread overview]
Message-ID: <b201d47b8865e79dfe9dc8ca4e8654ed@plan9.bell-labs.com> (raw)

> I can currently reach another network via two ssh hops.  Meaning
> that any files I need transfered between the machines on either
> end of the connections currently have to be transfered by making
> two scp hops.  This is a problem as the middle machine doesn't have
> much disk space.  So ideally I would like to run u9fs at one endpoint
> and sshnet behave as the tunnel.
>
> Am I just incorrect in my interpretation of the man page?

No, I was just confused about how transparent you
wanted the tunnel to be.  As long as you only need the
tunnel to be one way, this is easy.

Basically, if you do

	sshnet hop1
	mntgen
	srvssh hop2

(assuming u9fs is in your path on hop2),
that posts the u9fs service in /srv/hop2,
so that then running

	mntgen
	9fs hop2

in any other window (even without the sshnet)
will mount /n/hop2.

(You could just create /n/hop2, or put mntgen
in your profile.)

If you want more than just ssh access to the
network, you could adapt the following:

	g% cat /usr/rsc/bin/rc/mit
	#!/bin/rc

	if(test -d /net/mit){
		echo 'already have /net/mit' >[1=2]
		exit recursion
	}

	if(test -f /srv/mit)
		mount /srv/mit /net.mit
	if not
		sshnet -m /net.mit -s mit ny.lcs.mit.edu

	if(! test -d /net.mit/tcp){
		echo 'no /net.mit/tcp' >[1=2]
		exit network
	}

	aux/stub -d /net/mit
	bind /net.mit/tcp /net/mit
	g%

This is like just running sshnet, but you end up
being able to decide, on a per-call basis, which
network gets used: addresses like wherever or
tcp!wherever still go out on the local network,
while addresses like mit!wherever go out over
the sshnet tunnel.

If you are using mntgen you could change the
/net.mit's to /n/net.mit to avoid creating another
directory in the root.

Russ



             reply	other threads:[~2002-12-11 15:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-11 15:49 Russ Cox [this message]
2002-12-11 16:56 ` Jeff Sickel
  -- strict thread matches above, loose matches on Subject: below --
2002-12-11 14:00 Russ Cox
2002-12-11 14:47 ` Jeff Sickel
2002-12-11  9:52 Jeff Sickel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b201d47b8865e79dfe9dc8ca4e8654ed@plan9.bell-labs.com \
    --to=rsc@plan9.bell-labs.com \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).