duncs / clusterssh

Cluster SSH - Cluster Admin Via SSH
https://github.com/duncs/clusterssh/wiki
890 stars 79 forks source link

cssh opens extra windows #157

Closed skippy2481 closed 3 months ago

skippy2481 commented 3 months ago

using clusterssh to ssh into cell phones that I have running userland the ssh port is set to -p 2022 so when I add to a sh file for cluster like this...

cssh a1@192.168.1.11 -p 2022 a2@192.168.12 -p 2022 and so on and so on...... it opens two windows at the bottem one window is named p and the other is named 2022 how can I get around this and obtw I can't change the ssh port bact to default 22
and I also user clusterssh on the same pc with some pi's on port 22

cqexbesd commented 3 months ago

Off the top of my head as I'm not near a computer ... you need to get the -p passed to ssh, not cssh. There is a cssh config option for that. You could also specify ports in your SSH config and then it's just automatic without need command line arguments.

duncs commented 3 months ago

Make use of built in ssh functionality by adding entries into your own user ssh config file - ~/.ssh/config. For example, for each server (as per your list above)

host 192.168.1.11 a1
  hostname 192.168.1.11
  user a1
  port 2022

host 192.168.12 a2
  hostname 192.168.12
  user a2
  port 2022

and then you can either use the IP address or the alias defined on the host line to open the terminals to each host using the config provided: cssh a1 a2

Look at man ssh_config for more details on all the options available

skippy2481 commented 2 months ago

I only use port 2022 on userland to the phones and port 22 on everything else I figured it out tho: so I didn't want to edit the sshd_config default file

cssh -p 2022 192.168.1.2 192.168.1.3 and so on and so on insteat of specifying -p 2022 after each ip address: what it was doing was using the -p and 2022 on the end of the last ip address and opening a new session window for each