I want a bash script to start multiple SSH connections to multiple linux servers in multiple new bash windows, not for further processing, just to connect with a simple command instead of having to type the full ssh-lines every time I restart the bash (using WSL2/WSLg).
Opening new terminals and executing commands in them is no issue at all. Just running ssh (openSSH) is a problem in all three cases, since all throw the same error:
'ad port ' 12345
Executing it manually in bash I do invoke ssh like this: ssh firstname.lastname@example.org -p 12345
So I assume, like with every command I can just script it in following way:
#!/bin/bash ssh email@example.com -p 12345 ssh firstname.lastname@example.org -p 67890 ssh email@example.com -p 54321
Is this a script related issue, or might this be a WSL problem?
EDIT: I want to point out that my focus right now is mainly on the 'ad port ' error that I get. I have no idea what this is and I can't find anything useful about it on the Inet.
EDIT2: This is only an oversimplification of the code, since I am not allowed to share any details of the whole script. I know, that this code will just sequentially execute the ssh's but that's for testing only anyways. I just want to see the three connections being established in order (the logins are handled by RSA keypairs).
The whole script was written using NANO or VIM on a Proxmox->Debian server (virtual Debian running on Proxmox). So the CRLF line endings are sadly not the issue. Thanks for pointing this out though!
The issue wasn't solved directly but it could be adressed with another approach - using tmux - as suggested by @NotTheDr01ds !