#466350 cssh does not support wildcard .ssh/config Host entries

#466350#5
Date:
2008-02-18 08:26:26 UTC
From:
To:
  Hi,

  Due to firewalls, I use generic proxycommand in my .ssh/config.
I have something as:

Host *.fakedomain
ProxyCommand ssh fakedomain "tcpconnect `basename %h .fakedomain` %p"

Host fakedomain
Hostname firewall.fakedomain.org
User mylogin


This allow me to join any host 'foo' (behind the firewall) using:
ssh login@foo.fakedomain


  If I run 'cssh -e login@foo.fakedomain', it works
  If I add 'login@foo.fakedomain' in a tag, it does not. I got the error
message:
WARNING: 'foo.fakedomain' unknown (unable to resolve and not in user ssh
config file)

(foo.fakedomain is not in the ssh config file: it is *.fakedomain ...)

  So please, either disable this check or provide a way to disable it
(globaly or for specific computers or tags)
Here is what I do on my computer (this fix is too specific for my case,
so I did not add the tag 'patch' for this bugreport):
--- cssh.orig	2008-02-18 09:07:41.000000000 +0100
+++ cssh	2008-02-18 09:11:23.000000000 +0100
@@ -829,6 +829,9 @@
     if ( $ssh_hostnames{$host} ) {
       return 1;
     }
+    elsif ($host =~ /\.fakedomain$/) {
+      return 1;
+    }
     else {
       logmsg( 1, "Failed to check host (falling back to gethost): $!"
);
       return gethost($host);


  Best regards,
    Vincent

#466350#10
Date:
2008-02-18 15:39:20 UTC
From:
To:
Hi Vincent,

I'm going to check with upstream on this.  Have you tried using the -i
command-line switch?  In previous versions of clusterssh, this was the
appropriate way to ignore the warning.

Thanks,
Tony

Vincent Danjean wrote:

#466350#17
Date:
2008-06-10 09:51:22 UTC
From:
To:
A work around for this without having to edit cssh itself is to add a
false entry to /etc/hosts for the firewalled box. e.g.

127.0.0.1 foo.fakedomain

ssh honours the Host in ~/.ssh/config over the /etc/hosts entry.

Cheers,

Matt

#466350#22
Date:
2008-10-02 16:35:46 UTC
From:
To:
Vincent,

When you have time, could you see if the most recent upload of clusterssh
3.22-2 addresses the issue you're having?

Thank you,
Tony

#466350#27
Date:
2008-10-02 18:42:01 UTC
From:
To:
  Hi,

tony mancill wrote:

It works (ie I connect to all machines). However, I got a warning in the
initial shell (where I type 'cssh ...') AND in each opened terminal...

Adding entries in /etc/hosts is not a solution for me (too many fake hostnames
to add in several computers): I prefer to hack cssh itself :-)

[Sorry to not have answered before your previous mails but I do not subscribe
to the bug I report (and the BTS does not subscribe the submitter automatically :-( )
so I did not see them before]

  Regards,
    Vincent

#466350#32
Date:
2009-10-04 19:11:12 UTC
From:
To:
Hello Vincent,

Are you still having this problem with the more recent versions of
clusterssh?  The upstream author has addressed several issues with
ssh/.config in releases 3.23 and 3.24.

Thank you,
Tony

#466350#37
Date:
2010-01-05 01:10:40 UTC
From:
To:
retitle 466350 cssh does not support wildcard .ssh/config Host entries
thanks

Hi,

The proper way to fix this would be to use a method of matching on
%ssh_hostnames keys that isn't just an exact match, but also one that
checks if the keys match a wildcard pattern. Assuming the ssh config
globs are simple, a Perl Cookbook solution should be applicable:

sub glob2pat {
    my $globstr = shift;
    my %patmap = (
        '*' => '.*',
        '?' => '.',
        '[' => '[',
        ']' => ']',
    );
    $globstr =~ s{(.)} { $patmap{$1} || "\Q$1" }ge;
    return '^' . $globstr . '$';
}

Or use something like Text::Glob (libtext-glob-perl).