0
  • I connected two linuxes (CentOS7) with an ethernet cable, and
  • I did ifconfig <eth> 192.168.0.1 on the first and .. 0.2 on the second.
  • From the second, ping 192.168.0.1 works, but
  • ssh <mylogin_on_first>@192.168.0.1 does nothing (ends by an timeout)

Any ideas?

4

Ping uses the icmp protocol, which doesn't require a port.

ssh needs port 22 (by default) to be open on the machine to which you're attempting to connect, and an ssh daemon running.

To check the port is open on 'the first' machine, 192.168.0.1 :

 $ sudo firewall-cmd --list-services
   dhcpv6-client ssh samba-client

ssh should be listed as above. To check if the ssh daemon is running (on 'the first'):

 $ sudo systemctl status sshd
   sshd.service - OpenSSH server daemon
   Loaded: loaded (/usr/lib/systemd/system/sshd.service; disabled; vendor preset: disabled)
   Active: active (running) since Wed 2017-04-26 22:22:04 BST; 1s ago
   ...

It should be 'Active' as above.

Then, if needed, to open the port:

 $ sudo firewall-cmd --permanent --add-service=http
success
 $ sudo firewall-cmd --reload
success

And to start the service:

$ sudo systemctl start sshd

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.
{"cc_re__cc_re__cc_by_sa_3_0": ["<li class=\"-item\"><a href=\"https://www.facebook.com/officialstackoverflow/\" class=\"-link\">Facebook</a></li>\r\n                    <li class=\"-item\"><a href=\"https://twitter.com/stackoverflow\" class=\"-link\">Twitter</a></li>\r\n                    <li class=\"-item\"><a href=\"https://linkedin.com/company/stack-overflow\" class=\"-link\">LinkedIn</a></li>\r\n                </ul>\r\n\r\n                <p class=\"mt-auto mb24\">\r\nsite design / logo &#169; 2019 Stack Exchange Inc; user contributions licensed under <a href=\"https://creativecommons.org/licenses/by-sa/3.0/\" rel=\"license\">cc by-sa 3.0</a>\r\n                            with <a href=\"https://stackoverflow.blog/2009/06/25/attribution-required/\" rel=\"license\">attribution required</a>.\r\n                    <span id=\"svnrev\">rev&nbsp;2019.7.15.34328</span>\r\n                </p>\r\n            </div>\r\n        </div>\r\n\r\n            <div class=\"site-footer--extra ai-center\">\r\n                Linux is a registered trademark of Linus Torvalds. UNIX is a registered trademark of The Open Group. <br>This site is not affiliated wi"], "copyright__copyright__copyright": ["ive: active (running) since Wed 2017-04-26 22:22:04 BST; 1s ago\n   ...\n\nIt should be 'Active' as above.\n\nThen, if needed, to open the port:\n\n $ sudo firewall-cmd --permanent --add-service=http\nsuccess\n $ sudo firewall-cmd --reload\nsuccess\n\nAnd to start the service:\n\n$ sudo systemctl start sshd\n\nYour Answer\n\nBy clicking \u201cPost Your Answer\u201d, you agree to our terms of service, privacy policy and cookie policy\n\nNot the answer you're looking for? Browse other questions tagged or ask your own question."]}