Sample Header Ad - 728x90

ssh config: I have many hosts who I want to use settings from 2 different wildcard hosts respective, please review my attempt

0 votes
1 answer
530 views
I have 2 sets of hosts who I want to use settings from 2 seperate wildcard hosts. I also have a huge number of hosts so need help on which style is best for this scenario. The hosts are mostly in the format of x1 x2 x3... ### My attempts: 1:
host one
  user cat

host two
  hostname 2

host three
  hostname 3

host one two three
  user apple
  identityFile ~/.ssh/id_rsa

host x1
  hostname 7

host y2
  hostname 8

host z3
  hostname 9

host x1 y2 z3
  user duck
  identityFile ~/.ssh/quack
### Omitting the hosts only using the wild card hosts but they apply to the hosts. 2:
host x* y* z*
  user duck
  identityFile ~/.ssh/

# for hosts one two three

host * 
  user apple
  IdentityFile ~/.ssh/quack
Are these methods correct and Any suggestions for a better methods? Please critique.
Asked by Nickotine (554 rep)
Nov 3, 2023, 07:47 AM
Last activity: Nov 3, 2023, 09:10 AM