Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
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.
Hello,
In a server with multiple NICs and multiple IP addresses, the SSH service is running by default on all IP addresses? It means that you can connect to all IP addresses through SSH.
It depends on how it is set up to install by the package maintainer.
Typically, you can examine the file /etc/ssh/sshd_config to see how it is set up. I wouldn't make any assumptions about its default configuration, but rather I'd examine the contents of sshd_config and alter as desired.
So, for example, this is how part of sshd_config might look:
Code:
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options override the
# default value.
Include /etc/ssh/sshd_config.d/*.conf
#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
In this example (from Debian Stable), the commented options represent the defaults, and this includes listening on port 22 and allow listening on any address, from any address.
As mentioned twice above, the ListenAddress directive in /etc/ssh/sshd_config will allow you to choose which addresses and thus network interface.
You can add additional conditions to that using the Match directive. So you could allow keys or passwords on the LAN but require keys for access from the Internet.
It depends on how it is set up to install by the package maintainer.
Typically, you can examine the file /etc/ssh/sshd_config to see how it is set up. I wouldn't make any assumptions about its default configuration, but rather I'd examine the contents of sshd_config and alter as desired.
So, for example, this is how part of sshd_config might look:
Code:
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options override the
# default value.
Include /etc/ssh/sshd_config.d/*.conf
#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
In this example (from Debian Stable), the commented options represent the defaults, and this includes listening on port 22 and allow listening on any address, from any address.
Hello,
Thank you so much for your reply.
So, I can substitute the desired IP address instead of 0.0.0.0. Is it right?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.