GNU/Linux >> Linux の 問題 >  >> Linux

Ssh – Ssh Configの複数の同様のエントリ?

sshを設定したいとします .sshで同じ設定の30台のサーバーのオプション config ファイル:

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

これらの30台のマシン間で変更されるのはXXXだけです。 。

configで上記の構造を30回繰り返す代わりに ファイル、マシンの範囲を定義する別の方法はありますか?

承認された回答:

ssh_config(5)から マニュアルページ:

 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).

だから:

Host XXX1 XXX2 XXX3
  HostName %h.YYY.com

Linux
  1. Ssh – Ssh / scp / sftpユーザーをディレクトリに制限しますか?

  2. Ssh – Sshが許可を求めるのを避ける方法は?

  3. 複数のホストにSSHで接続し、コマンドを実行しますか?

  1. Ssh –とにかくSudoをSshプロキシコマンドに組み込むには?

  2. SSHログインを特定のIPまたはホストに制限する

  3. 仮想ホストを使用して複数のドメインにサービスを提供

  1. 単一ホスト上の複数の glibc ライブラリ

  2. 中間ホスト経由でファイルを再同期する

  3. 2 つの SSH サーバーの実行