Ubuntu 16.04 ssh on a LAN fails with "connection refused"

خرید بک لینک

I've found the easiest way to resolve ssh connection issues is to use the debug mode of both the client and server applications.

On one machine, we'll call it pcA, open a terminal and run the following command:

/usr/sbin/sshd -d -p 2222

On the other linux machine, pcB, enter this command and watch the server output on pcA:

ssh -vv -p 2222 [IP Address of pcA]

What we are doing here is running a 'foreground' version of the ssh daemon on pcA, listening for connections on port 2222, running in debug (verbose) mode. On pcB we are attempting to connect to pcA as an ssh client on port 2222, in verbose mode.

  • Both pcA and pcB will output text indicating the flow of the connection process as they see it.

  • Typically the results are sufficient to make the resolution obvious e.g. permissions on your ~/.ssh directory.

    A couple tips:

    If the server sees absolutely no connection attempt from pcB, then you have a firewall or networking routing issue of some sort. In this case, try a network scan on the same port from pcB using nmap: nmap -p 2222 [ip address pcA]

    You can also call nmap with syntax nmap -A [ip address pcA] to do a general scan (including the std sshd port (22) and traceroute info. This might indicate where things are getting dropped (router firewall?)

  • If it isn't obvious post the results from both the client and server in your question.

- - , .
.

Recent Questions...

ما را در سایت Recent Questions دنبال می‌کنید

برچسب: نویسنده: استخدام کار بازدید: 257 تاريخ: دوشنبه 21 تير 1395 ساعت: 8:06

صفحه بندی