Menu

#45 How not to mangle "user@host" parameter?

v1.0 (example)
open
nobody
None
5
2014-04-09
2014-04-09
No

Hello.

I need to jump over a custom ssh-relay software to get to my destination host.
For example, to get to be "root@target", I would need to call ssh like this:

ssh -p 2222 -t blindcoder@sshrelay root@target
blindcoder@sshrelay's password: ***
root@target:~#

To simplify this, I added the following to .ssh/config:
host target
hostname sshrelay
port 2222
RequestTTY yes
user root

So now I can do this:

ssh target root@target
blindcoder@sshrelay's password: ***
root@target:~#

But when trying to do this with cssh:
cssh "target root@target"
cssh will instead run this command:
Running:ssh -l target root target

I patched ClusterSSH/Helper.pm lines 111 ff. like this to achieve what I need:

           #if(\$user) {
               #unless("$comms" eq "telnet") {
                   #\$user = \$user ? "-l \$user " : "";
                   #\$user = \$user ? " \$user\\\@\$svr " : "";
                   #\$command .= \$user;
               #}
           #}
           if("$comms" eq "telnet") {
               \$command .= "\$svr \$port";
           } else {
               if (\$port) {
                   \$command .= "-p \$port \$user\\\@\$svr";
               } else {
                 \$command .= "\$user\\\@\$svr";
               }
           }

But I'd really really like not to have to patch cssh files to achieve this.

Do you have a suggestion on how to achieve this without patching cssh?

Kind regards,
Benjamin

Discussion


Log in to post a comment.