Linux - Software This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
12-19-2009, 12:27 PM
|
#1
|
Senior Member
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,430
Rep:
|
Does anyone know how to specify a ssh port number with fanout?
Does anyone know how to specify a ssh port number with fanout?
I tried
hostname ort
hostname -p#
hostname -p #
and none worked.
|
|
|
12-19-2009, 08:50 PM
|
#2
|
Senior Member
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098
Rep:
|
should be
ssh user@hostname -p <port number>
Just tried it and it works for me.
|
|
|
12-19-2009, 08:58 PM
|
#3
|
Senior Member
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,430
Original Poster
Rep:
|
Quote:
Originally Posted by jstephens84
should be
ssh user@hostname -p <port number>
Just tried it and it works for me.
|
Was that with fanout or fanterm?
|
|
|
12-19-2009, 09:04 PM
|
#4
|
Senior Member
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098
Rep:
|
No that was with the command line but doesn't fanout just initiate multiple commands?
|
|
|
12-19-2009, 09:10 PM
|
#5
|
Senior Member
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,430
Original Poster
Rep:
|
Quote:
Originally Posted by jstephens84
No that was with the command line but doesn't fanout just initiate multiple commands?
|
Some what, the syntax is:
Code:
fanout "server100 server101" "reboot && exit"
but you can't do server100 -p9999, nor server100:9999
|
|
|
12-19-2009, 09:18 PM
|
#6
|
Senior Member
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098
Rep:
|
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.
|
|
|
12-19-2009, 09:21 PM
|
#7
|
Senior Member
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,430
Original Poster
Rep:
|
Quote:
Originally Posted by jstephens84
so you might try to add the host to the ssh file and then call it.
|
Thanks!
This file?
so put the host and port number in there?
|
|
|
12-19-2009, 09:23 PM
|
#8
|
Senior Member
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098
Rep:
|
Quote:
Originally Posted by abefroman
Thanks!
This file?
so put the host and port number in there?
|
possibly. Here is some more information that I dug up.
Here is an example ~/.ssh/config file.
Host *panix.com
User suominen
Compression no
Host *gw.com
FallBackToRsh no
Host *
Compression yes
CompressionLevel 9
FallBackToRsh yes
KeepAlive no
however I can't find all the allowed attributes. I did just find this one from Red Hat magazine.
Host wiki.pretendco.com
Hostname localhost
Port 2200
Last edited by jstephens84; 12-19-2009 at 09:24 PM.
|
|
|
12-19-2009, 09:24 PM
|
#9
|
Senior Member
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,430
Original Poster
Rep:
|
Quote:
Originally Posted by jstephens84
possibly. Here is some more information that I dug up.
Here is an example ~/.ssh/config file.
Host *panix.com
User suominen
Compression no
Host *gw.com
FallBackToRsh no
Host *
Compression yes
CompressionLevel 9
FallBackToRsh yes
KeepAlive no
however I can't find all the allowed attributes.
|
Thanks I'll check that out.
|
|
|
12-19-2009, 09:25 PM
|
#10
|
Senior Member
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098
Rep:
|
|
|
|
12-19-2009, 09:29 PM
|
#11
|
Senior Member
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,430
Original Poster
Rep:
|
Actually the fanout binary is actually a script not a binary, so I can just add -p9999 to the source code to the fanout script.
Or if you have multiple ports you use you can just make multiple copies of fanout.
Ex: fanout8 for port 8765
fanout9 for 9999
etc.
|
|
|
12-19-2009, 09:32 PM
|
#12
|
Senior Member
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098
Rep:
|
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.
|
|
|
12-20-2009, 07:46 AM
|
#13
|
Senior Member
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,767
Rep:
|
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).
|
|
|
All times are GMT -5. The time now is 01:46 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|