LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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


Reply
  Search this Thread
Old 12-19-2009, 12:27 PM   #1
abefroman
Senior Member
 
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,430

Rep: Reputation: 55
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
hostnameort
hostname -p#
hostname -p #

and none worked.
 
Old 12-19-2009, 08:50 PM   #2
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
should be
ssh user@hostname -p <port number>

Just tried it and it works for me.
 
Old 12-19-2009, 08:58 PM   #3
abefroman
Senior Member
 
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,430

Original Poster
Rep: Reputation: 55
Quote:
Originally Posted by jstephens84 View Post
should be
ssh user@hostname -p <port number>

Just tried it and it works for me.
Was that with fanout or fanterm?
 
Old 12-19-2009, 09:04 PM   #4
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
No that was with the command line but doesn't fanout just initiate multiple commands?
 
Old 12-19-2009, 09:10 PM   #5
abefroman
Senior Member
 
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,430

Original Poster
Rep: Reputation: 55
Quote:
Originally Posted by jstephens84 View Post
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
 
Old 12-19-2009, 09:18 PM   #6
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
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.
 
Old 12-19-2009, 09:21 PM   #7
abefroman
Senior Member
 
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,430

Original Poster
Rep: Reputation: 55
Quote:
Originally Posted by jstephens84 View Post
so you might try to add the host to the ssh file and then call it.
Thanks!

This file?
Code:
~/.ssh/config
so put the host and port number in there?
 
Old 12-19-2009, 09:23 PM   #8
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by abefroman View Post
Thanks!

This file?
Code:
~/.ssh/config
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.
 
Old 12-19-2009, 09:24 PM   #9
abefroman
Senior Member
 
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,430

Original Poster
Rep: Reputation: 55
Quote:
Originally Posted by jstephens84 View Post
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.
 
Old 12-19-2009, 09:25 PM   #10
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
I think this will help you out a lot.

http://magazine.redhat.com/2007/11/27/advanced-ssh-configuration-and-tunneling-we-dont-need-no-stinking-vpn-software/
 
Old 12-19-2009, 09:29 PM   #11
abefroman
Senior Member
 
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,430

Original Poster
Rep: Reputation: 55
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.
 
Old 12-19-2009, 09:32 PM   #12
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
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.
 
Old 12-20-2009, 07:46 AM   #13
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
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).
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
USB to serail port adaptor COM port number areftaidi Linux - Software 2 09-25-2007 01:05 AM
Howto do Secured ssh from port https or port80(standard) to ssh d listening port 22 ? Xeratul Linux - General 4 11-23-2006 06:09 AM
iptables help! DROP ssh port, but allow to connect to ssh if from 2222 port kandzha Linux - Networking 4 09-13-2006 09:10 AM
Change ssh port number israel Linux - Software 2 08-30-2006 05:18 AM
Able to change port number between telnet and ssh? x5452 Linux - General 3 03-28-2004 05:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration