You are not logged in.

#1 2013-05-06 16:05:59

LuX
Member
From: France
Registered: 2010-06-14
Posts: 79

ssh: Connection refused (solved)

Hello!

I have since last week-end the following problem on my laptop (at home).

- At login, my system opens an ssh tunnel between my work an my home, using the following command written in my .bash_profile:

ssh -N -i *some-key*  *my-login-name@my-work* -L2222:*a-computer-at-work*:22 2> /dev/null &

- I then used to connect to my work through this tunnel using the following command:

ssh -t -p 2222 localhost

This doesn't work anymore, and the second command gives me:

ssh: connect to host localhost port 2222: Connection refused

I have commented the above 'ssh -N...' command in my .bash_profile and restarted. I then noticed that sshd.service was no longer running: even 'ssh localhost' answered 'Connection refused'. Thus I re-enabled sshd.service using systemctl, restarted and 'ssh localhost' works fine again, but still not the above 'ssh -t...' command (wether or not I run first the above 'ssh -N...' command!).

I feel very uncomfortable on questions concerning network, and I have absolutely no idea of what is going on here. I haven't moved to netctl yet, but a priori it shouldn't have to do with my problem since I do connect myself to the internet without problem (I can post on this forum...). At first I would like to know if the problem comes from the first command (the tunnel does not open for some unknown reason) or the second one. How could I test it?

Regards,
LuX

Last edited by LuX (2013-05-07 07:43:32)

Offline

#2 2013-05-06 17:16:59

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,728

Re: ssh: Connection refused (solved)

Is that computer at work behind a firewall?


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2013-05-06 23:47:37

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,217
Website

Re: ssh: Connection refused (solved)

Offline

#4 2013-05-07 07:43:13

LuX
Member
From: France
Registered: 2010-06-14
Posts: 79

Re: ssh: Connection refused (solved)

The problem was only that my IP address had been blacklisted. Sorry for this pointless post, and thank you for the answers.

It is strange that sshd.services was disabled, though. Maybe only sshd.socket used to be enabled previously. Anyhow, everything is working fine now, so...

Last edited by LuX (2013-05-07 07:46:40)

Offline

Board footer

Powered by FluxBB