#para permitir la autenticacion con contraseña, en lugar de clave privada

PasswordAuthentication yes

#permitir redirigir salida X windows

X11Forwarding yes

#permitir redirigir los puertos de un tunel a otra maquina local

AllowTcpForwarding yes

#permitir solo el acceso a ciertos usuarios

AllowUsers zozo pincho

solo para usuario pincho: solo conexiones a IP 192.168.0.2, al puerto RDP 3389. Y solo con clave RSA, no con contraseña.

Match User pincho

      AllowTcpForwarding yes
      permitopen="192.168.0.2:3389"
      PasswordAuthentication no

#verificar que es lo que pasa con detalle: /var/log/auth.log

LogLevel VERBOSE

#referencia para depuracion: #http://docstore.mik.ua/orelly/networking_2ndEd/ssh/ch05_08.htm

#ssh -R *:9300:localhost:22 user@middleserver *Setting the bind address to * will forward connections on any interface and not just loopback ('lo' which includes 127.0.0.1 == localhost ). ifconfig lists the interfaces.. i.e. eth0, lo, and wlan0.*

#ejemplo: host1$ ssh -N -R 8822:localhost:22 remote.host.com

Now from remote, you can SSH to host1 like this: (The remote port 8822 forwards to host1, but only on the loopback interface.)

I figured out the solution to the ssh_exchange_id: Connection closed by remote host error. Execute both

chmod 700 ~/.ssh

and

chmod 600 ~/.ssh/authorized_keys

to get the permissions set correctly.

# another possible solution. # $(which sshd) -Ddp 10222 /etc/ssh/sshd_config line 8: address family must be specified before ListenAddress.

ssh -N -l pincho -p 3000 -L -D9000 localhost -vvv –> las conexiones al puerto 9000 redirigidas dinamicamente

para redirigir la conexion de una drac a traves de un tunel ssh, hay que redirigir los puertos 80, 443, 5900, 5901 (activex al menos)

-R *:2222:localhost:22 -l usuario host desde maquina virtual

-L 22:localhost:2222 desde maquina maestro.

EJEMPLO DE DENEGACION DE SERVICIO USANDO SSH FORWARDING: (no usar remotamente, aviso)

(xterm 1) usuario$ssh -v -L4444:localhost:4444 localhost (xterm 2) usuario$ssh -v -R4444:localhost:4444 localhost (xterm 3) usuario$telnet localhost 4444

ejemplo tomado de http://www.semicomplete.com/articles/ssh-security/