FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 01-16-2009, 10:16 PM
NoOp
 
Default ssh - connection refused

On 01/16/2009 01:54 PM, frmas wrote:
> Hi,
> I've tried to connect my office computer (client) to my home computer
> (server), using ssh, but I always have the same message returned when I
> run : ssh 85.201.23.11 -p 5317
> "ssh: connect to host 85.201.23.11 port 5317; Connection refused".
>
> When I restart ssh from my home computer (server), I have always the
> same error message in the auth log file :
> Jan 16 22:34:45 serv sshd[12379]: error: Bind to port 5317 on 0.0.0.0
> failed: Address already in use.
> (I don't use port 22, and here port 5317 is not the one I use really
> ;-)), it 's just for the purpose of that message.
>
> This is my /etc/ssh/sshd_config file
>
> Port 5317

The first thing to do is ensure that it works with 22 properly. Then
just change as above to 5317. I've just done this on one of my machines
after first ensuring that it works with 22 and performing a 'sudo
/etc/init.d/ssh restart on the 5317 target machine:

====
$ ssh -X <username>@<ipaddress> -p 5317
<username>@<ipaddress>'s password:
Linux <machinename> 2.6.24-23-generic #1 SMP Thu Nov 27 18:44:42 UTC
2008 i686

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

To access official Ubuntu documentation, please visit:
http://help.ubuntu.com/
Last login: Fri Jan 16 15:02:37 2009 from <machinename>
<username@<machinename>:~$
====


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 01-16-2009, 11:02 PM
Smoot Carl-Mitchell
 
Default ssh - connection refused

On Fri, 2009-01-16 at 22:54 +0100, frmas wrote:

> When I restart ssh from my home computer (server), I have always the
> same error message in the auth log file :
> Jan 16 22:34:45 serv sshd[12379]: error: Bind to port 5317 on 0.0.0.0
> failed: Address already in use.
> (I don't use port 22, and here port 5317 is not the one I use really
> ;-)), it 's just for the purpose of that message.

The above message means port 5317 is in use by another process. Try
doing this to find out what is using port 5317:

sudo lsof -i | grep 5317
--
Smoot Carl-Mitchell
Computer Systems and
Network Consultant
smoot@tic.com
+1 480 922 7313
cell: +1 602 421 9005

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 01-17-2009, 05:37 AM
frmas
 
Default ssh - connection refused

Smoot Carl-Mitchell a écrit :
>> When I restart ssh from my home computer (server), I have always the
>> same error message in the auth log file :
>> Jan 16 22:34:45 serv sshd[12379]: error: Bind to port 5317 on 0.0.0.0
>> failed: Address already in use.
>> (I don't use port 22, and here port 5317 is not the one I use really
>> ;-)), it 's just for the purpose of that message.
>
> The above message means port 5317 is in use by another process. Try
> doing this to find out what is using port 5317:
>
> sudo lsof -i | grep 5317

This is the output I get :
me@myhome:~$ sudo lsof -i | grep 5317
[sudo] password for me:
sshd 5812 root 3u IPv6 14878 TCP *:5317 (LISTEN)
me@myhome:~$

So nothing else is using it I guess. Francois
--

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 01-17-2009, 12:56 PM
Smoot Carl-Mitchell
 
Default ssh - connection refused

On Sat, 2009-01-17 at 07:37 +0100, frmas wrote:

> > sudo lsof -i | grep 5317
>
> This is the output I get :
> me@myhome:~$ sudo lsof -i | grep 5317
> [sudo] password for me:
> sshd 5812 root 3u IPv6 14878 TCP *:5317 (LISTEN)
> me@myhome:~$
>
> So nothing else is using it I guess. Francois

You should be able to connect to the daemon. If you still get
connection refused, then you might have a firewall rules which are
responding to the connection request by refusing the connection. Do you
have a firewall or are yo using iptables or some other firewall on the
server? You can test if you are using iptales by doing:

sudo iptables -L
--
Smoot Carl-Mitchell
Computer Systems and
Network Consultant
smoot@tic.com
+1 480 922 7313
cell: +1 602 421 9005

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 01-17-2009, 04:40 PM
frmas
 
Default ssh - connection refused

Smoot Carl-Mitchell a écrit :
>>> sudo lsof -i | grep 5317
>> This is the output I get :
>> me@myhome:~$ sudo lsof -i | grep 5317
>> [sudo] password for me:
>> sshd 5812 root 3u IPv6 14878 TCP *:5317 (LISTEN)
>> me@myhome:~$
>>
>> So nothing else is using it I guess. Francois
>
> You should be able to connect to the daemon. If you still get
> connection refused, then you might have a firewall rules which are
> responding to the connection request by refusing the connection. Do you
> have a firewall or are yo using iptables or some other firewall on the
> server? You can test if you are using iptales by doing:
>
> sudo iptables -L

It gives me this output :

sudo iptables -L
[sudo] password for me:
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Francois
--

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 01-17-2009, 05:24 PM
frmas
 
Default ssh - connection refused

NoOp a écrit :
>> I've tried to connect my office computer (client) to my home computer
>> (server), using ssh, but I always have the same message returned when I
>> run : ssh 85.201.23.11 -p 5317
>> "ssh: connect to host 85.201.23.11 port 5317; Connection refused".
>>
>> When I restart ssh from my home computer (server), I have always the
>> same error message in the auth log file :
>> Jan 16 22:34:45 serv sshd[12379]: error: Bind to port 5317 on 0.0.0.0
>> failed: Address already in use.
>> (I don't use port 22, and here port 5317 is not the one I use really
>> ;-)), it 's just for the purpose of that message.
>>
>> This is my /etc/ssh/sshd_config file
>>
>> Port 5317
>
> The first thing to do is ensure that it works with 22 properly. Then
> just change as above to 5317. I've just done this on one of my machines
> after first ensuring that it works with 22 and performing a 'sudo
> /etc/init.d/ssh restart on the 5317 target machine:

Hmmm, from your post and the tests I did, the problem could be somewhere
else, so. I have a local lan, and running from my laptop (homelaptop)
the following command :
ssh -X homeserver -p 5317
it works fine, but the auth log file on the "server", shows a connection
from computer homelaptop with ip 192.168.1.12. So I wonder whether or
not the ssh connection is thru the local network only or thru the
internet first, then thru my local network.
Then, the pb could come from my router, and its configuration. Francois

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 01-17-2009, 05:48 PM
Smoot Carl-Mitchell
 
Default ssh - connection refused

On Sat, 2009-01-17 at 19:24 +0100, frmas wrote:

> Hmmm, from your post and the tests I did, the problem could be somewhere
> else, so. I have a local lan, and running from my laptop (homelaptop)
> the following command :
> ssh -X homeserver -p 5317
> it works fine, but the auth log file on the "server", shows a connection
> from computer homelaptop with ip 192.168.1.12. So I wonder whether or
> not the ssh connection is thru the local network only or thru the
> internet first, then thru my local network.
> Then, the pb could come from my router, and its configuration. Francois

Your tests indicate the ssh configuration on the server is fine. It
sounds like you are blocking a connection from the Internet on your
firewall. I suspect the firewall is setup to return an ICMP Connection
refused packet when a connection request is received on port 5317.
--
Smoot Carl-Mitchell
Computer Systems and
Network Consultant
smoot@tic.com
+1 480 922 7313
cell: +1 602 421 9005

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 01-17-2009, 07:18 PM
frmas
 
Default ssh - connection refused

Smoot Carl-Mitchell a écrit :
>> Hmmm, from your post and the tests I did, the problem could be somewhere
>> else, so. I have a local lan, and running from my laptop (homelaptop)
>> the following command :
>> ssh -X homeserver -p 5317
>> it works fine, but the auth log file on the "server", shows a connection
>> from computer homelaptop with ip 192.168.1.12. So I wonder whether or
>> not the ssh connection is thru the local network only or thru the
>> internet first, then thru my local network.
>> Then, the pb could come from my router, and its configuration. Francois
>
> Your tests indicate the ssh configuration on the server is fine. It
> sounds like you are blocking a connection from the Internet on your
> firewall. I suspect the firewall is setup to return an ICMP Connection
> refused packet when a connection request is received on port 5317.

I have added an entry as "virtual server", in my router settings.
This is what I added :
Enable (x)
Name : ssh
IP Address : 192.168.1.17 (the IP of my homeserver on the local lan)
Protocol : TCP
Private port : 22
Public port : 5317
Inbound filter : allow all
Schedule : Always.

But could the problem come from the settings I added to the
/etc/ssh/sshd_config file with :
# What ports, IPs and protocols we listen for - Default is 22
Port 5317

Should I change it to 22 in my sshd_config file, as I "translate" the
public port 5317 to a private port 22 on my router settings?
Francois

--

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 01-17-2009, 08:30 PM
Smoot Carl-Mitchell
 
Default ssh - connection refused

On Sat, 2009-01-17 at 21:18 +0100, frmas wrote:

> I have added an entry as "virtual server", in my router settings.
> This is what I added :
> Enable (x)
> Name : ssh
> IP Address : 192.168.1.17 (the IP of my homeserver on the local lan)
> Protocol : TCP
> Private port : 22
> Public port : 5317
> Inbound filter : allow all
> Schedule : Always.

Sounds like you are inbound NATing from port 5317 on the public network
to 22 on the private network.
>
> But could the problem come from the settings I added to the
> /etc/ssh/sshd_config file with :
> # What ports, IPs and protocols we listen for - Default is 22
> Port 5317
>
> Should I change it to 22 in my sshd_config file, as I "translate" the
> public port 5317 to a private port 22 on my router settings?

Changing the port to 22 should resolve your problem.

--
Smoot Carl-Mitchell
Computer Systems and
Network Consultant
smoot@tic.com
+1 480 922 7313
cell: +1 602 421 9005

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 01-18-2009, 12:53 AM
NoOp
 
Default ssh - connection refused

On 01/17/2009 10:24 AM, frmas wrote:
> NoOp a écrit :
[snip]
>> The first thing to do is ensure that it works with 22 properly. Then
>> just change as above to 5317. I've just done this on one of my machines
>> after first ensuring that it works with 22 and performing a 'sudo
>> /etc/init.d/ssh restart on the 5317 target machine:
>
> Hmmm, from your post and the tests I did, the problem could be somewhere
> else, so. I have a local lan, and running from my laptop (homelaptop)
> the following command :
> ssh -X homeserver -p 5317
> it works fine, but the auth log file on the "server", shows a connection
> from computer homelaptop with ip 192.168.1.12. So I wonder whether or
> not the ssh connection is thru the local network only or thru the
> internet first, then thru my local network.
> Then, the pb could come from my router, and its configuration. Francois
>

It suspect the problem is with your router/firewall.

1. When you 'ssh -X homeserver -p 5317' the ssh is from within your own
intranet. That appears to be normal and working.

2. When you try the same via the public internet the connection is
blocked or mis-routed. From your other post:

> have added an entry as "virtual server", in my router settings.
> This is what I added :
> Enable (x)
> Name : ssh
> IP Address : 192.168.1.17 (the IP of my homeserver on the local lan)
> Protocol : TCP
> Private port : 22
> Public port : 5317
> Inbound filter : allow all
> Schedule : Always.

It would be impossible to tell what the issue is on your router and/or
firewall unless you identify what the router/firewall is. If you'd like
to test from outside, drop me a note directly and I'll be happy to
attempt ssh connections to you from the outside. You'll be able to tell
who/what it's coming from that way. No need to give me any password etc,
just the details of the port & with those I'll be able to tell you if I
get an ssh prompt back from your system.



--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 

Thread Tools




All times are GMT. The time now is 08:53 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org