~/.ssh/config
Host descriptive_name
HostName host.domain or IP
Port 8080 # if it's different to 22 by default
User root
ServerAliveInterval 60
ServerAliveCountMax 10
ForwardX11 yes # is necessary server configuration
Host tunel-ssh
HostName hosts.domain or IP
User userforssh
ServerAliveInterval 60
ServerAliveCountMax 10
DynamicForward 1080 # port on localhost
ControlMaster auto
ControlPath ~/.ssh/sockets/%h:%p
Host anotherserver
HostName anotherserver.domain
User root
ServerAliveInterval 60
ServerAliveCountMax 10
ProxyCommand nc.openbsd -x localhost %h %p # it's for make ssh through tunel-ssh
Podemos poner tantas configuraciones como queramos con la única restricción de que los nombres descriptivos no pueden repetirse.
Luego basta con escribir en línea de comandos:
ssh tunel-ssh
y tendremos un tunel ssh a nuestro puerto 1080 de localhost.
ssh descriptive_name
hará un ssh con la parametrización que le hayamos puesto en el fichero config.
No hay comentarios:
Publicar un comentario