From: Luciano Rocha <luciano@eurotux.com>
To: Jakub Narebski <jnareb@gmail.com>
Cc: Alex Riesen <raa.lkml@gmail.com>, git@vger.kernel.org
Subject: Re: Help! My ISP blocks repo.or.cz. How to push changes?
Date: Mon, 12 Jan 2009 11:20:07 +0000 [thread overview]
Message-ID: <20090112112007.GA3841@bit.office.eurotux.com> (raw)
In-Reply-To: <200901121213.45858.jnareb@gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 1333 bytes --]
On Mon, Jan 12, 2009 at 12:13:44PM +0100, Jakub Narebski wrote:
> Alex Riesen wrote:
> > 2009/1/12 Jakub Narebski <jnareb@gmail.com>:
>
> > > Do you have any suggestions to bypass this block for git? I have access
> > > to Linux shell account (no root access, though) which doesn't have
> > > problems with repo.or.cz, so I think I could set up SSH tunnel: but
> > > how? And what to do with access via git:// - move to SSH too?
> >
> > See man ssh, look for -L. It works for arbitrary ports, so you can redirect
> > git:// port to anywhere. Same for push over ssh, just give another port when
> > connecting.
>
> Currently I have the folowing in my ~/.ssh/config:
>
> # TP S.A. blocks repo.or.cz
> Host repo.or.cz
> NoHostAuthenticationForLocalhost yes
> HostName localhost
> Port 2222
>
> and I can simply use "git push repo" without any changes.
> But I have to run
>
> $ ssh -f -N -L 2222:repo.or.cz:22 jnareb@host.example.com
>
> first. Is there any way to automate this?
For those cases I use the attached script. Read the first lines, with
information on how to install.
The end result is that I can do:
ssh host1--host2--host3
Or scp, rsync, etc.
Regards,
Luciano Rocha
--
Luciano Rocha <luciano@eurotux.com>
Eurotux Informática, S.A. <http://www.eurotux.com/>
[-- Attachment #1.2: ssh_p --]
[-- Type: text/plain, Size: 2166 bytes --]
#!/bin/bash
## SSH connection chaining
##
## (C) 2007, Luciano Rocha <strange@nsk.pt>
##
## This program is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License
## as published by the Free Software Foundation; either version 2
## of the License, or (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
## MA 02110-1301, USA.
##
## Or check the webpage: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
##
## Documentation:
##
## Include in your .ssh/config:
## host *--*
## proxycommand ssh_p %h %p
##
## And then you can do:
## ssh hosta--hostb--hostc
## scp hosta--hostb--hostc:file .
##
## A user specification is also possible, but not for the last host, for
## that one, you'll have to use ssh's standard user specification (user@host
## or -luser):
## ssh usera_hosta--userb_hostb--hostc -luserc
## scp userc@usera_hosta--userb_hostb--hostc:file .
##
## Compression is disable on all proxy sshs, as traffic is already encrypted.
## Activate compression in the master ssh command, if desired.
##
## Environment variable SSH_CONFIG_FILE can point to a ssh configuration
## file for use in the proxy sshs.
## missing hops
h="${1%--*}"
## nc target
rh="${1##*--}"
p="${2:-22}"
## user for next hop
u=
n="${h##*--}"
if [ -z "${n##*_*}" ]; then
u=${n%%_*}
if [ "$h" != "$n" ]; then
h="${h%--*}--${n##*_}"
else
h="${n##*_}"
fi
fi
echo "${SSH_INDENT}+ connecting to $h for $rh" >&2
exec env SSH_INDENT="${SSH_INDENT} " ssh -o "Compression no" \
${SSH_CONFIG_FILE:+-F$SSH_CONFIG_FILE} \
${u:+$u@}$h \
"echo \"${SSH_INDENT}- connected to $h, forwarding to $rh:$p\" >&2 ; nc -w 3600 $rh $p"
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
next prev parent reply other threads:[~2009-01-12 11:28 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-12 1:46 Help! My ISP blocks repo.or.cz. How to push changes? Jakub Narebski
2009-01-12 9:17 ` Alex Riesen
2009-01-12 11:13 ` Jakub Narebski
2009-01-12 11:20 ` Luciano Rocha [this message]
2009-01-12 11:25 ` Asheesh Laroia
2009-01-12 23:39 ` Jakub Narebski
2009-01-13 20:13 ` Asheesh Laroia
2009-01-12 12:23 ` Mike Hommey
2009-01-12 23:43 ` Jakub Narebski
2009-01-13 0:59 ` Markus Heidelberg
2009-01-14 13:55 ` Help! My ISP blocks repo.or.cz. How to push changes? (a solution) Jakub Narebski
2009-01-14 17:18 ` Asheesh Laroia
2009-01-12 9:21 ` Help! My ISP blocks repo.or.cz. How to push changes? Asheesh Laroia
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=20090112112007.GA3841@bit.office.eurotux.com \
--to=luciano@eurotux.com \
--cc=git@vger.kernel.org \
--cc=jnareb@gmail.com \
--cc=raa.lkml@gmail.com \
/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).