Tunnel Reverso ssh en Centos 8

Paso1: (Instalar)

yum -y install epel-release

yum -y install autossh

Paso2: (Generar llaves Transferir llaves)

[root@dev .ssh]# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
6a:72:14:1a:6b:3f:f0:10:44:93:5c:a3:78:a9:22:e2 root@dev.nitcom.com
The key’s randomart image is:
+–[ RSA 2048]—-+
| o+oo |
| oo+ . |
| . * . |
| o = . |
|+ . * . S |
|+. . * . |
| E . B |
| + . |
| |
+—————–+

Transferir

[root@dev .ssh]# ssh-copy-id -i /root/.ssh/id_rsa.pub linux@ns.nitcom.com
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed — if you are prompted now it is to install the new keys
linux@ns.nitcom.com’s password:

Number of key(s) added: 1

Now try logging into the machine, with: “ssh ‘linux@ns.nitcom.com’”
and check to make sure that only the key(s) you wanted were added.

Paso #3 (Probar , sin clave)

[root@dev .ssh]# ssh linux@ns.nitcom.com
Last login: Wed Mar 20 13:50:25 2019 from 186.163.9.7
[linux@ns ~]$

Paso #4 (autossh)

autossh -M 10984 -N -f -o “PubkeyAuthentication=yes” -o “PasswordAuthentication=no” -i /root/.ssh/id_rsa -R 9999:localhost:22 linux@ns.nitcom.com

Paso#5 : (Cambiar puerto ssh de Maquina ns o invitada)

Paso6# : probar los resultados

[root@ns ~]# ssh galania@localhost -p 9999
galania@localhost’s password:
Last login: Mon Apr 29 13:48:13 2019 from localhost
[galania@dev ~]$

Responder

Por favor, inicia sesión con uno de estos métodos para publicar tu comentario:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión /  Cambiar )

Google photo

Estás comentando usando tu cuenta de Google. Cerrar sesión /  Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión /  Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión /  Cambiar )

Conectando a %s

Este sitio usa Akismet para reducir el spam. Aprende cómo se procesan los datos de tus comentarios .