SSH connection refused
Hi all,
I am relatively new to Linux, am running LinuxMint (Katya). I have been able to ssh into my box from outside (including Putty) previously, and can ssh out from my box. For some reason I no longer can ssh in. I've read a lot of the forums and tried a lot like wiping the known_hosts and flushing iptables. Output from iptables -L is: Quote:
I simply get: Quote:
|
Try adding the "-v" option to the ssh command for more information as to why the connection is being refused.
|
Quote:
|
Ok, so i probably should have made that -vvv
|
Quote:
|
-v increases verbosity, -vvv increases it more... you should be seeing some "debug3" messages, im not sure why your not getting that..
try "netstat -tnlp" to see if sshd is listening on the correct port. |
More v's add verbosity (man ssh...). Perhaps the server has some more info in its logs?
Try Code:
grep -Ri ssh /var/log/* |
Quote:
|
You should forward some WAN-facing port to tcp/22 on that box.
|
Remove the "-p xxxx" and try it...
|
Quote:
|
As Juako said, check the port forwards on your router.
Also try "ssh localhost" to try and isolate the problem. You said that it WAS working, and just stopped working? What happened prior to that? Was there an update, a change in router settings, change in sshd_config settings? As Juako also said, check the sshd logs... Im not sure where Mint puts them, so use grep as they suggested. |
Ok, so I tried shh localhost and that works.
The only thing I can think is my friend was using Putty to connect and might not have allowed authenticity or something. He was quite vague. I think this is the appropriate line: Quote:
|
ok, im not sure what the deal is with putty, ive only used it a couple of times.
Quote:
can you try changing LogLevel to DEBUG in /etc/ssh/sshd_config then Code:
tail -f /var/log/auth.log then try and connect again, and post everything that comes up from the blank lines.. |
So I get:
Quote:
|
1) how are you forwarding the port?
2) go to http://www.whatsmyip.org does it say your ip is 86.184.34.109 3) i dont know if one can put putty in verbose mode, but if you can, do that? does it have a more descriptive error? is putty set to use the correct port? 4) is the putty box behind a firewall that is preventing it from getting through? 5) did Juako's suggestion of "grep -Ri ssh /var/log/*" come up with any thing? |
Have you checked whether sshd service is up and running properly on both the machines?
and the iptables setting of both the machines needs to be checked You have posted the iptables output of your machine and not of the machine of your friend. There is no issue with putty. It is something with the sshd service Check whether your ssh service is up and running Code:
#ps -aux | grep sshd Code:
#netstat -nap | grep :22 Code:
#service sshd restart and check the connectivity to make sure both machines are in network Code:
#ping 192.168.0.X(IP of your friends machine) Try connecting to any other machine whether it gives the same error from both the machines. (and all the above things needs to be checked on both machines) |
Is the ssh server daemon running on the target machine? Not all distros enable the server (which is what answers your ssh request) by default.
You can check whether it is like this: Code:
~$ ps -A | grep sshd Also, make sure the ssh port (22 by default) is open in the firewall. I spent 15 minutes on the phone with a friend today. He was getting the exact results OP is getting and not having sshd running was the reason. |
All times are GMT -5. The time now is 07:28 AM. |