acceder a la página web a través de ssh

acceder a la página web a través de ssh

Necesito acceder a IEEE xplore, pero no tengo derecho a descargarlo fuera del instituto.

Puedo iniciar sesión en el servidor del instituto a través de ssh,

Entonces, ¿cómo puedo acceder a IEEE xplore a través del servidor del instituto a través de ssh?

He buscado soluciones, alguien responde:

ssh -L 8080:localhost:80 user@remoteserver

y luego dice:

Ahora, apunte su navegador local a localhost:8080. Debería reenviarse a localhost:80 en el servidor remoto.### Pero todavía no sé cómo configurar mi computadora portátil, estoy usando Chrome.

¡Agradezco mucho tu ayuda!

Respuesta1

Primer método:

Lanzar un túnel SSH

Para iniciar su túnel SSH, simplemente abra la terminal y conéctese a su servidor remoto a través de SSH con las siguientes opciones:

ssh -D 8080 -C -N [email protected]

Navega por la Web con tu túnel SSH (Chrome)

Ahora comencemos a navegar por la web usando nuestro nuevo túnel SSH.

  • Abre Google Chrome
  • Seleccione el ícono de llave inglesa en la parte superior derecha
  • Seleccione 'Configuración'
  • Seleccione 'Mostrar configuración avanzada...'
  • Seleccione 'Cambiar configuración de proxy…'
  • Seleccione 'Proxy SOCKS'
  • Ingrese '127.0.0.1'
  • Ingrese al puerto '8080′
  • Guarde los cambios seleccionando 'Aceptar'

Busca en Google 'mi ip' y mira cuál es tu dirección IP ahora.

Esto iniciará nuestro túnel SSH en el puerto 8080 y enrutará todo el tráfico (de forma segura) a través del servidor en example.com.

Salir del túnel SSH

Para salir del túnel SSH, simplemente deshabilite el proxy SOCKS en su navegador.

fuente

Segundo método:

Puedes hacerlo fácilmente usando Shellinabox

Asegúrese de haber marcado Universe Repository

Instalar

 $ sudo apt-get install openssl shellinabox

Configurando Shellinabox

De forma predeterminada, shellinaboxd escucha en el puerto TCP 4200 en localhost. Durante la instalación, se crea automáticamente un nuevo certificado SSL autofirmado en “/var/lib/shellinabox” para usar el protocolo HTTPS.

$ sudo vi /etc/default/shellinabox

# specify the IP address of a destination SSH server
SHELLINABOX_ARGS="--o-beep -s /:SSH:172.16.25.125"

# if you want to restrict access to shellinaboxd from localhost only
SHELLINABOX_ARGS="--o-beep -s /:SSH:172.16.25.125 --localhost-only"

NB: reemplaza la ip 172.16.25.125 por la tuya

Iniciando Shellinabox

Una vez que haya terminado con la configuración, puede iniciar el servicio.

$ sudo service shellinaboxd start

Verificar Shellinabox

Ahora verifiquemos si Shellinabox se está ejecutando en el puerto 4200 usando el comando "netstat".

$ sudo netstat -nap | grep shellinabox
or
# netstat -nap | grep shellinabox

tcp        0      0 0.0.0.0:4200            0.0.0.0:*               LISTEN      12274/shellinaboxd

Ahora abra su navegador web y navegue hasta 'https://"Su-dirección-IP:6175"'. Debería poder ver una terminal SSH basada en web. Inicie sesión con su nombre de usuario y contraseña y se le presentará el indicador de shell.

ingrese la descripción de la imagen aquí

fuente

Respuesta2

El ejemplo que proporcionaste es correcto, pero algo engañoso. Esto debería funcionar:

ssh -L 8080:<remote-web-host-you-want-to-see>:80 remote-user@remote-ssh-server

Por ejemplo, considere una caja remota que ejecuta ssh y que puede acceder a esta página web, que quiero ver localmente:

http://192.168.1.2/index.html

Para crear un túnel en mi caja local que me permita navegar a esa página remota, ejecuto localmente:

ssh -L 8080:192.168.1.2:80 user@remote-ssh-server

Y luego, en un navegador web, visito:

http://localhost:8080/index.html

Si necesita (o desea) omitir el especificador de puerto, deberá abrir el túnel como root, ya que 80 es un puerto "privilegiado" (<1024):

sudo ssh -L 80:<remote-web-host-you-want-to-see>:80 remote-user@remote-ssh-server

Luego, puedes visitar localmente:

http://localhost/index.html

No se requiere ninguna otra configuración.

Por cierto, esto sólo funciona para unsolterohost que desea ver localmente. Si necesita ver más, debe abrir más túneles en otros puertos o examinar las otras soluciones que canalizan solicitudes para todos los hosts remotos a través de un proxy.

Este es el tercer uso del -Linterruptor de man ssh:

 -L [bind_address:]port:host:hostport
 -L [bind_address:]port:remote_socket
 -L local_socket:host:hostport
 -L local_socket:remote_socket
         Specifies that connections to the given TCP port or Unix socket on the
         local (client) host are to be forwarded to the given host and port, or
         Unix socket, on the remote side.  This works by allocating a socket to
         listen to either a TCP port on the local side, optionally bound to the
         specified bind_address, or to a Unix socket.  Whenever a connection is
         made to the local port or socket, the connection is forwarded over the
         secure channel, and a connection is made to either host port hostport,
         or the Unix socket remote_socket, from the remote machine.

         Port forwardings can also be specified in the configuration file.  Only
         the superuser can forward privileged ports.  IPv6 addresses can be
         specified by enclosing the address in square brackets.

         By default, the local port is bound in accordance with the GatewayPorts
         setting.  However, an explicit bind_address may be used to bind the
         connection to a specific address.  The bind_address of “localhost”
         indicates that the listening port be bound for local use only, while an
         empty address or ‘*’ indicates that the port should be available from
         all interfaces.

información relacionada