Does anyone know how to specify a ssh port number with fanout?
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
According to a site that I found you can't do that. the syntax is
fanout [--noping] "{space separated list of systems}" "{commands to run}"
However this looks like it might help us a little.
A "System" is a bit of a misnomer; it could be a fully qualified domain, an entry in /etc/hosts, an IP address, an entry in ~/.ssh/config, or any of those preceeded with user_account@ . In short, if you can type ssh something and get a command prompt, it can be used as a "system" above.
so you might try to add the host to the ssh file and then call it.
nice so it looks like you have two ways to accomplish that. If you create the config file then you only have to maintain one copy of it. However if that doesn't work then as you said you can create multiple fanout files.
Too many tools that run "ssh" to communicate with a remote host are not considering the port number as one of the elements of identifying the remote. I don't know about "fanout" but I know I have this trouble with "rsync". Part of the problem is "ssh" didn't really integrate the port number as part of the remote identity, probably due to the history of "ssh" using separate options. If you will note, the URL does have a capability to include a port number.
I get around this by front-ending "ssh" with a script first in my path called "ssh". This is found by "rsync" as expected. My script checks for an explicit "-p" option and uses that if present. Else it checks for an environment variable "SSHPORT" and uses that for the path. Else it does a lookup via an alternate configuration data tree based on both username and hostname. Else it just runs "ssh" without a "-p" option and lets "ssh" figure it out based on its usual limited config file.
But it really would have helped if we had a better "login resource locator" that included the port number along with the username and hostname (or IP address).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.