Acceder à un linux en vnc via un tunnel SSH

Statut
N'est pas ouverte pour d'autres réponses.

Gh0$T

Elite
Bonjour,

Voilà, j'utilise un tunnel SSH pour me connecter au réseau de mon entreprise.

Pour VNC j'utilise les ports 5800 et 5900 pour acceder à un serveur VNC.

Sous windows, pas de soucis mais sous linux je dois ajouter après mon adresse :1 (selectionner un bureau je pense). En local ça fonctionne sans soucis mais via le tunnel rien à faire ça ne fonctionne pas.

Est ce que vous avez une astuces pour cela ?

Merci.
 
G

grosnours

ex membre
Essaie les ports 5801 et 5901.
 

Phoen1X

Elite
je suis également interessé par la demande, sous windows, pas de problème pour utiliser vnc via le tunnel.

Sous linux, pas de problème pour controler ou accéder à mes fichiers via ssh mais faire transiter vnc ... :-s
 
G

grosnours

ex membre
ssh -L 5801:vnc.domain.tld:5801 -L 5901:vnc.domain.tld:5901 gw.domain.tld
vncviewer localhost:1
 

Phoen1X

Elite
ca c est de la commande ^^

tu pourrais si possible expliquez les différents paramètres de la commande ?

Merci ;)
:-D
 
G

grosnours

ex membre
Bien sûr, man ssh:
man ssh a dit:
-L [bind_address:]port:host:hostport
Specifies that the given port on the local (client) host is to be forwarded to the given host and port on the remote side. This
works by allocating a socket to listen to port on the local side, optionally bound to the specified bind_address. Whenever a
connection is made to this port, the connection is forwarded over the secure channel, and a connection is made to host port
hostport from the remote machine. Port forwardings can also be specified in the configuration file. IPv6 addresses can be spec-
ified with an alternative syntax: [bind_address/]port/host/hostport or by enclosing the address in square brackets. Only the
superuser can forward privileged ports. By default, the local port is bound in accordance with the GatewayPorts setting. How-
ever, an explicit bind_address may be used to bind the connection to a specific address. The bind_address of ``localhost'' indi-
cates that the listening port be bound for local use only, while an empty address or `*' indicates that the port should be avail-
able from all interfaces.
Exemple avec RDP (port tcp/3389), VNC est plus "complexe" à cause des sessions (le fameux :1 dont ghost parle).

Tu as au boulot deux machines.
Une où seul ssh (port tcp/22) incoming est autorisé à partir d'internet (0.0.0.0/0) : ssh.phoenix.be. Une où seul rdp (port tcp/3389) incoming est autorisé à partir du LAN: rdp.phoenix.be. La machine ssh est la seule à avoir une IP publique sur Internet. Les deux machines ont une IP privée dans un LAN arbitraire.

Tu ne peux donc pas te connecter de chez toi directement à rdp.phoenix.be.
Tu fais donc un tunnel ssh depuis ta machine, port local arbitraire (disons 12345), vers remotehost:remoteport (donc dans notre cas, rdp.phoenix.be:3389) en passant par ssh.phoenix.be.
On obtient donc: ssh -L 12345:rdp.phoenix.be:3389 ssh.phoenix.be .
Tu utiliseras comme ip:port 127.0.0.1:12345 pour te connecter avec ton client rdp.

Si rdp.phoenix.be autorisait ssh depuis internet, tu obtiendrais: ssh -L 12345:localhost:3389 rdp.phoenix.be .
 

Phoen1X

Elite
merci grosnous ;)

voilà un + bien mérité :-D
 
Statut
N'est pas ouverte pour d'autres réponses.
Haut