GNU/Linux >> Linux Esercitazione >  >> Linux

Ssh:più voci simili in Ssh Config?

Supponi di voler configurare il mio ssh opzioni per 30 server con la stessa configurazione nel mio .ssh config file:

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

dove l'unica cosa che cambia tra queste 30 macchine è XXX .

Invece di ripetere la struttura sopra 30 volte nel mio config file, c'è un altro modo per definire un intervallo di macchine?

Risposta accettata:

Da ssh_config(5) pagina 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).

Quindi:

Host XXX1 XXX2 XXX3
  HostName %h.YYY.com

Linux
  1. Comandi multipli in Sshpass?

  2. Come digitare la password per più finestre?

  3. Ssh su più host ed eseguire un comando?

  4. Come utilizzare lo stesso alias Ssh con più indirizzi/porte/ecc. host?

  5. Rsync file tramite host intermedio

Utilizzo del file di configurazione SSH

Più librerie glibc su un singolo host

SSH - Come includere il comando -t nel file ~/.ssh/config

Esecuzione di più thread scp contemporaneamente

aggiungendo la password a .ssh/config

Come utilizzare SSH direttamente per indirizzare tramite jumphost utilizzando SSH Config senza comando ssh aggiuntivo