Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
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.
Sorry to be troubling you with a simple question. I'm using SuSe 13.2. I've just reconnected two machines to my network after a re-install. They will connect to the rest of the network via ssh but only if I specify the port I want them to use in the terminal ssh command, otherwise I get 'connect to host ******* port 22:connection refused'. I'm sure I set the config and sshd_config files to 'port ****'. These are being overridden by something I guess, but what is it, where is it, and what do I do about it? The other machines in the network connect normally and I'm pretty well certain that the machines and the reinstall are OK.
On the client, you would specify the default for any given host (or pattern of hosts) using the ssh_config file. Normally, it is found in ~/.ssh/config. Check what you have there. See the manual page for ssh_config for all your options.
Also, which version of OpenSSH (?) are you running from your client?
Turbocapitalist, I think you must be thinking of something else. There is a config file in /home/username/.ssh but it's not at all like the ssh_config file which is in /etc/ssh. This is the problem, mine are exactly as the Suse manuals etc. say they should be.
The syntax is the same, /etc/ssh/ssh_config is the system-wide configuration and ~/.ssh/config is the users configuration file.
As far as I know the ssh client will always use the default port (22) unless it is specified on the command line with the -p option or as configured in a config file.
Quote:
I'm sure I set the config and sshd_config files to 'port ****'.
Where or how did you set the config file? We assume it is your clients user ~/.ssh/config file but some clarification is required.
Yes, the syntax for both client configuration files is the same. If you had a newer version of the client you could use the -G option to see your configuration settings for that specific connection.
However with 6.6.1p1 you'll have to walk through it manually and work the final constellation out in your head, if you don't want to post parts here. The options are applied on a first match basis and they are looked for first among the command-line options, next inside the user configuration file (usually ~/.ssh/config), and lastly inside the system-wide configuration file (/etc/ssh/ssh_config)
Thanks for these replies. I set port 2233 in ~/.ssh/config and in /etc/ssh/sshd_config. As far as I remember when I set the network up originally I didn't do anything to /etc/ssh/ssh_config and indeed it is still set to port 22. Yet the other client machines (with port 2233 set) are still ok with the server. They're more or less identical machines and all have the same os on them.
Given the order these files connect in then it seems that's where the problem lies. I'll go through and reset them all and see what happens.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.