GNU/Linux >> Tutoriales Linux >  >> Linux

Ssh – ¿Múltiples entradas similares en Ssh Config?

Digamos que quiero configurar mi ssh opciones para 30 servidores con la misma configuración en mi .ssh config archivo:

host XXX
     HostName XXX.YYY.com
     User my_username
     Compression yes
     Ciphers arcfour,blowfish-cbc
     Protocol 2
     ControlMaster auto
     ControlPath ~/.ssh/%[email protected]%h:%p
     IdentityFile ~/.ssh/YYY/id_rsa

donde lo único que cambia entre estas 30 máquinas es XXX .

En lugar de repetir la estructura anterior 30 veces en mi config archivo, ¿hay otra forma de definir un rango de máquinas?

Respuesta aceptada:

Desde el ssh_config(5) página man:

 Host    Restricts the following declarations (up to the next Host key‐
         word) to be only for those hosts that match one of the patterns
         given after the keyword.  If more than one pattern is provided,
         they should be separated by whitespace.

 HostName
         Specifies the real host name to log into.  This can be used to
         specify nicknames or abbreviations for hosts.  If the hostname
         contains the character sequence ‘%h’, then this will be replaced
         with the host name specified on the commandline (this is useful
         for manipulating unqualified names).

Entonces:

Host XXX1 XXX2 XXX3
  HostName %h.YYY.com

Linux
  1. Ssh:¿restringir un usuario de Ssh/scp/sftp a un directorio?

  2. Múltiples comandos en Sshpass?

  3. Ssh:¿cómo evitar que Ssh pida permiso?

  4. Ssh:¿de todos modos incorporar Sudo en un comando proxy Ssh?

  5. Restrinja el inicio de sesión SSH a una IP o host específico

Uso del archivo de configuración SSH

Ssh:¿problema común de manejo de archivos de múltiples conexiones Ssh?

¿Cómo escribir la contraseña para varias ventanas?

Ssh:¿Scp a través de varios hosts?

¿Ssh a múltiples hosts y ejecutar un comando?

¿Cómo usar el mismo alias Ssh con múltiples direcciones de host/puertos/etc.?