[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ssh config per domain



On Wed, Apr 02, 2014 at 05:09:07PM +0400, sergio wrote:
> 
> Хочу включить определённую ssh опцию только для хостов в mydomain.com
> 
> Для этого в ~/.ssh/config пишу так:
> 
> host *.mydomain.com
> 	FooBar yes
> 
> и для 'ssh bar.mydomain.com' имею FooBar=yes
> 
> Но mydomain.com прописан в /etc/resolv.conf и дописывать его каждый раз
> к имени хоста радости нет никакой.
> 
> 
> host *
>   CanonicalizeHostname yes
>   CanonicalDomains mydomain.com
> 
> не помогло.
> 
> Я хочу невозможного?

Возможно, но только с OpenSSH 6.5 и дальше.

Из /usr/share/doc/openssh-client/changelog.Debian.gz (Debian testing):

...
openssh (1:6.5p1-1) unstable; urgency=medium

  * New upstream release (http://www.openssh.com/txt/release-6.5,
    LP: #1275068):
    - ssh(1): Add support for client-side hostname canonicalisation using a
      set of DNS suffixes and rules in ssh_config(5).  This allows
      unqualified names to be canonicalised to fully-qualified domain names
      to eliminate ambiguity when looking up keys in known_hosts or checking
      host certificate names (closes: #115286).
...

Так что, начиная с версии 6.5, OpenSSH умеет "догадываться", что при
"ssh straylight" нужно глянуть на "Host straylight.m.ringlet.net".

> Сгодиться матчить и kerberos realm'у, но это вроде только лишь моя фантазия.

Про то не знаю.

Всего лучшего,
Петр

-- 
Peter Pentchev	roam@ringlet.net roam@FreeBSD.org p.penchev@storpool.com
PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115  C354 651E EFB0 2527 DF13
If this sentence didn't exist, somebody would have invented it.

Attachment: signature.asc
Description: Digital signature


Reply to: