Cómo hacer un túnel SSH para leer el correo IMAP

Publicado el 1 de October de 2005 por Paco

Nada especial, esta vez. Resulta que, normalemente, tengo disponible el IMAP sólo en la red local de casa. Cuando salgo y tengo conexión, si quiero leer el correo, utilizo un túnel SSH.

Seguro que mis telecos favoritos :-) me hacen alguna corrección pero, básicamente, un túnel ssh es una conexión que me permite de manera transparente redirigir un puerto de la máquina local a otro puerto de una máquina remota de manera segura.

La nota me la pongo a mí mismo, porque cada vez que quiero hacerlo pierdo 15 minutos buscando por la página man. La sintaxis es la siguiente:

ssh -NL 1430:localhost:143 usuario@servidorsshremoto

El comando me permite conectarme al servidor IMAP del servidor remoto diciéndole al cliente de correo que el servidor está en localhost y en el puerto 1430.

Adicionalmente, podemos añadir -f para que el proceso quede en background

ssh -NfL 1430:localhost:143 usuario@servidorsshremoto

Valga el truco para todas las mentes olvidadizas de la blogosfera :-)

Publicado bajo Libre, Software |

Un comentario

  1. Gravatar del autor del comentario

    Jo faig els tunels SSH així O:-)

    int sp[2];

    socketpair (AF_UNIX, SOCK_STREAM, 0, sp);
    if (! fork ())
    {
    close (sp[0]);
    dup2 (sp[1], 0);
    dup2 (sp[1], 1);
    execlp (”ssh”, “ssh”, (char *)hostname, (char *)command, NULL);
    }
    close (sp[1]);
    /* read/write sobre sp[0], en el fons van sobre stdout/stdin de la comanda remota… */


Deja un comentario

Por favor, ten en cuenta que: Los comentarios están moderados y la publicación del comentario podría demorarse hasta ser aprobaddo.

Publicidad

Más publicidad :-)

advising investment services best hyip monitoring rating best hyip program best investment firm best investment opportunity best mutual funds classics investment operator reminiscence stock wiley club estate investment real diversified investment essential of investment estate investment property real estate investment real trust extra income fixed income from investment profit uranium us fundamentals of investment gold investment high capital investments high income high profit fund raising high profit margin high yield investments highest financial returns highest fixed rate hyip invest hyip investment hyip monitoring hyip rating income opportunity investment an introduction investment casting investment club investment company investment land investment portfolio investment property investment putnam investment strategy new hyip offshore investment real estate investment club stock investment guide top mutual funds