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


14

Necesito acceder al IEEE xplore, pero no tengo derecho a descargarlo 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, alguna respuesta:

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!


Respuestas:


23

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 los siguientes indicadores:

ssh -D 8080 -C -N username@example.com

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 icono de llave inglesa en la esquina 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 el puerto '8080 ′
  • Guarde los cambios seleccionando 'Aceptar'

Busque en Google 'mi ip' y eche un vistazo a cuál es su dirección IP ahora.

Esto lanzará 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 desactive el proxy SOCKS dentro de su navegador.

fuente

Segundo método

Puedes hacerlo fácilmente usando Shellinabox

Asegúrese de haber verificado Universe Repository

Instalar

 $ sudo apt-get install openssl shellinabox

Configurando Shellinabox

Por defecto, shellinaboxd escucha en el puerto TCP 4200 en localhost. Durante la instalación, un nuevo certificado SSL autofirmado creado automáticamente 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: reemplace la ip 172.16.25.125 con la suya

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: // "Your-IP-Adress: 6175"'. Debería poder ver un terminal SSH basado en la web. Inicie sesión con su nombre de usuario y contraseña y se le presentará su solicitud de shell.

ingrese la descripción de la imagen aquí

fuente


@maythus, muchas gracias, tus respuestas son geniales.
Resuelvo

@ ulyssis2 Eres muy bienvenido amigo
Maythux

@kimerseen De nada amigo
Maythux

@Maythux me puedes ayudar con mi pregunta askubuntu.com/questions/987626/shell-in-a-box-session-closed
MiHawk

2

El ejemplo que proporcionó 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 un cuadro remoto que ejecuta ssh 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 casilla 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 quiere) omitir el especificador de puerto, deberá abrir el túnel como raíz, 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, puede visitar localmente:

http: //localhost/index.html

No se requiere otra configuración.

Por cierto, esto solo funciona para un único host que desea ver localmente. Si necesita ver más, debe abrir más túneles en otros puertos o examinar las otras soluciones que el túnel solicita para todos los hosts remotos a través de un proxy.

Este es el tercer uso del -Lcambio desde 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.
Al usar nuestro sitio, usted reconoce que ha leído y comprende nuestra Política de Cookies y Política de Privacidad.
Licensed under cc by-sa 3.0 with attribution required.