I am using cssh to telnet into multiple hosts at the same time.

I have changed the ssh=/usr/bin/telnet to point to the telnet program.

The problem I am facing is that each host uses different port for telnet.

I tried the following format but it did not work

cssh host1:100 host2:200 host3:300

How do I specify different port numbers for the different host?

1 Answer 1


First off why are you creating an alias for ssh to point to telnet? I believe you can just use ctel as described below in the man page for cssh:

Connections are opened via ssh so a correctly installed and configured ssh installation is required. If, however, the program is called by "crsh" then the rsh protocol is used (and the communications channel is insecure), or by "ctel" then telnet is used.

Here is the syntax for it: ctel [options] [<server>[:port]|<tag>] [...]

So you should be able to get it to work by using:

ctel host1:100 host2:200 host3:300

  • I tried after changing the value of "ssh" in .csshrc, but the following error is thrown when specifying the port: Testing comms - running command: /usr/bin/telnet -p 23 x.x.x.x echo Working /usr/bin/telnet: invalid option -- p Looks like ctel is trying to pass -p option to telnet which is not valid.
    – Manoj
    Commented Feb 4, 2014 at 9:01
  • When I tried creating a link to cssh from ctel, without editing the .csshrc file, the command is still trying to invoke ssh : /usr/bin/ssh -x -o ConnectTimeout=10 -p 23 x.x.x.x
    – Manoj
    Commented Feb 4, 2014 at 9:04
  • Looks like it was a bug fixed in later versions of cssh. I am using RHEL 5.8 and find no packages with the fix. I am not sure how to build one myself.
    – Manoj
    Commented Feb 4, 2014 at 9:32
  • You could just do the same thing with a simple bash script. Make a list of Hosts on the network then: For i in LIST; do telnet HOST1 echo Working done
    – Kentgrav
    Commented Feb 7, 2014 at 2:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .