LINUX.ORG.RU
ФорумAdmin

ssh config file

 


0

1

День добрый! Есть пачка хостов с одинаковым именем отличающимся только цифрой server[01:20]-prod.corp.ru

Есть задача добавить их в .ssh/config

Добавлять 20 записей в конф файл вида

host server01 HostName server01.prod.corp.ru User poo

мне очень лениво, может можно как-то указать диапазон значений чтобы ssh схавал его?

вроде этого host server01-20 HostName server01-20.prod.corp.ru user poo

[man ssh_config] -> Patterns
A pattern consists of zero or more non-whitespace characters, '*' (a wildcard that matches zero or more characters), or '?' (a wildcard that matches exactly one character). For example, to specify a set of declarations for any host in the ''.co.uk'' set of domains, the following pattern could be used:

Host *.co.uk
The following pattern would match any host in the 192.168.0.[0-9] network range:

Host 192.168.0.?
A pattern-list is a comma-separated list of patterns. Patterns within pattern-lists may be negated by preceding them with an exclamation mark ('!'). For example, to allow a key to be used from anywhere within an organisation except from the ''dialup'' pool, the following entry (in authorized_keys) could be used:

from="!*.dialup.example.com,*.example.com"

i3wm
()
Host server*
    User poo
    HostName %h.prod.comp.ru
beastie ★★★★★
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.