# Access Git ssh on port 8822 ?

4 messages from 2018-09-19 to 2018-09-19. Participants: Leonardo Bozzi, Jeff King, Ævar Arnfjörð Bjarmason.
Thread: https://gitlist.dev/t/49386

## Leonardo Bozzi, 2018-09-19 17:47

Subject: Access Git ssh on port 8822 ?
Message-ID: <CACrY0PAM=Ek5T_3oYkT0zMoAsULDfu9JAYm3xJdEqaxvxpQiwQ@mail.gmail.com>
URL: https://gitlist.dev/e/CACrY0PAM%3DEk5T_3oYkT0zMoAsULDfu9JAYm3xJdEqaxvxpQiwQ%40mail.gmail.com

```
Good afternoon, I'm trying to set up a git server, but I want to use
ssh access to connect clients on my server, but because of a
limitation in my internet provider it blocks access from outside on
port 22, so I changed the same from ssh to 8822. But when I give the
command:

$git remote add origin bozzi@bozzi.net:/opt/gitcurso

The server blocks me because I would have to access via port 8822. How
do I make the connection correctly?

I'm Debian user.

```

## Jeff King, 2018-09-19 17:50

Subject: Re: Access Git ssh on port 8822 ?
Message-ID: <20180919175045.GA10005@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20180919175045.GA10005%40sigill.intra.peff.net
In-Reply-To: <CACrY0PAM=Ek5T_3oYkT0zMoAsULDfu9JAYm3xJdEqaxvxpQiwQ@mail.gmail.com>

```
On Wed, Sep 19, 2018 at 02:47:09PM -0300, Leonardo Bozzi wrote:

> Good afternoon, I'm trying to set up a git server, but I want to use
> ssh access to connect clients on my server, but because of a
> limitation in my internet provider it blocks access from outside on
> port 22, so I changed the same from ssh to 8822. But when I give the
> command:
> 
> $git remote add origin bozzi@bozzi.net:/opt/gitcurso
> 
> The server blocks me because I would have to access via port 8822. How
> do I make the connection correctly?

You have two options:

  1. You can use the more verbose ssh URL syntax, which allows a port
     number:

       git clone ssh://bozzi@bozzi.net:8822/opt/gitcurso

  2. You can use a host block in your ~/.ssh/config to set the default
     port for that host.

       {
         echo "Host bozzi.net"
	 echo "Port 8822"
       } >>$HOME/.ssh/config

-Peff

```

## Leonardo Bozzi, 2018-09-19 18:48

Subject: Re: Access Git ssh on port 8822 ?
Message-ID: <CACrY0PDzo8EayzV6Zg1jWALu-9m+txkp87un0SbMr3hVUynrOA@mail.gmail.com>
URL: https://gitlist.dev/e/CACrY0PDzo8EayzV6Zg1jWALu-9m%2Btxkp87un0SbMr3hVUynrOA%40mail.gmail.com
In-Reply-To: <20180919175045.GA10005@sigill.intra.peff.net>

```
Ok
       git clone ssh://bozzi@bozzi.net:8822/opt/gitcurso

access sucess.



Adm. Leonardo Bozzi
Administrador / Analista de Sistemas
Tel.:  (27) 99988-4576
CRA-ES: 13256


Em qua, 19 de set de 2018 às 14:50, Jeff King <peff@peff.net> escreveu:
>
> On Wed, Sep 19, 2018 at 02:47:09PM -0300, Leonardo Bozzi wrote:
>
> > Good afternoon, I'm trying to set up a git server, but I want to use
> > ssh access to connect clients on my server, but because of a
> > limitation in my internet provider it blocks access from outside on
> > port 22, so I changed the same from ssh to 8822. But when I give the
> > command:
> >
> > $git remote add origin bozzi@bozzi.net:/opt/gitcurso
> >
> > The server blocks me because I would have to access via port 8822. How
> > do I make the connection correctly?
>
> You have two options:
>
>   1. You can use the more verbose ssh URL syntax, which allows a port
>      number:
>
>        git clone ssh://bozzi@bozzi.net:8822/opt/gitcurso
>
>   2. You can use a host block in your ~/.ssh/config to set the default
>      port for that host.
>
>        {
>          echo "Host bozzi.net"
>          echo "Port 8822"
>        } >>$HOME/.ssh/config
>
> -Peff

```

## Ævar Arnfjörð Bjarmason, 2018-09-19 20:04

Subject: Re: Access Git ssh on port 8822 ?
Message-ID: <87sh25jlsn.fsf@evledraar.gmail.com>
URL: https://gitlist.dev/e/87sh25jlsn.fsf%40evledraar.gmail.com
In-Reply-To: <20180919175045.GA10005@sigill.intra.peff.net>

```

On Wed, Sep 19 2018, Jeff King wrote:

> On Wed, Sep 19, 2018 at 02:47:09PM -0300, Leonardo Bozzi wrote:
>
>> Good afternoon, I'm trying to set up a git server, but I want to use
>> ssh access to connect clients on my server, but because of a
>> limitation in my internet provider it blocks access from outside on
>> port 22, so I changed the same from ssh to 8822. But when I give the
>> command:
>> 
>> $git remote add origin bozzi@bozzi.net:/opt/gitcurso
>> 
>> The server blocks me because I would have to access via port 8822. How
>> do I make the connection correctly?
>
> You have two options:
>
>   1. You can use the more verbose ssh URL syntax, which allows a port
>      number:
>
>        git clone ssh://bozzi@bozzi.net:8822/opt/gitcurso
>
>   2. You can use a host block in your ~/.ssh/config to set the default
>      port for that host.
>
>        {
>          echo "Host bozzi.net"
> 	 echo "Port 8822"
>        } >>$HOME/.ssh/config
>
> -Peff

3. GIT_SSH_COMMAND="ssh -p 8822"  git clone bozzi@bozzi.net:/opt/gitcurso

```
