You are not logged in.

#1 2009-03-30 22:30:33

Sjoden
Member
From: WA
Registered: 2007-08-16
Posts: 380
Website

[Solved, I am an idiot] Can only connect to ssh listening on port 22

I'm rebuilding my slicehost slice and while setting up ssh, I'm having problems using any port other than 22. I keep getting this error message.

[zack@robot ~]$ ssh username@website.net -p 6666
ssh: connect to host website.net port 6666: Connection refused

Running netstat -l shows the service running, and using the web console from slicehost, running the above ssh command works localy with the correct port, but not from outside.

I'm only using a different port to reduce the log entries from bots trying to connect on port 22. And 6666 isn't the one I'm actually trying to use, but I'm not trying to use one of the 'well known' ports.

Now if I change the port number in ssh_config, sshd_config and iptables.rules to 22 and restart the services, everything works just fine. I can't figure out where my problem is.

Last edited by Sjoden (2009-03-31 21:05:38)

Offline

#2 2009-03-30 23:23:37

ataraxia
Member
From: Pittsburgh
Registered: 2007-05-06
Posts: 1,553

Re: [Solved, I am an idiot] Can only connect to ssh listening on port 22

Slicehost doesn't block "weird" ports at the border, does it?

Offline

#3 2009-03-30 23:36:34

Sjoden
Member
From: WA
Registered: 2007-08-16
Posts: 380
Website

Re: [Solved, I am an idiot] Can only connect to ssh listening on port 22

ataraxia wrote:

Slicehost doesn't block "weird" ports at the border, does it?

Agh, I really hope not.

I installed lighttpd and was able to have that listen on port 80 and I could view the little index.html I made, but I couldn't connect to ssh running on port 80. I did change the port in ssh_config and sshd_config, and I restarted the service afterward. I didn't try both at the same time. I tried lighttpd after ssh failed. When I started lighttpd, it complained saying that it couldn't bind port 80, which meant ssh was, but I still wasn't able to connect to it.

Offline

#4 2009-03-31 00:19:13

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

Re: [Solved, I am an idiot] Can only connect to ssh listening on port 22

Do you have a local firewall running, on either end (ie, on the slicehost, or at home / work / where ever you're connecting from)

Offline

#5 2009-03-31 02:03:26

Gen2ly
Member
From: Sevierville, TN
Registered: 2009-03-06
Posts: 1,529
Website

Re: [Solved, I am an idiot] Can only connect to ssh listening on port 22

Unsure but I think /etc/hosts.allow uses /etc/services.  If it does only port 22 is being allowed?


Setting Up a Scripting Environment | Proud donor to wikipedia - link

Offline

#6 2009-03-31 04:36:51

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

Re: [Solved, I am an idiot] Can only connect to ssh listening on port 22

Gen2ly wrote:

Unsure but I think /etc/hosts.allow uses /etc/services.  If it does only port 22 is being allowed?

This isn't the problem. I run ssh on non-standard ports and I've never had to adjust hosts.allow or /etc/services apart from the normal mods (sshd=ALL)

Last edited by fukawi2 (2009-03-31 04:37:07)

Offline

#7 2009-03-31 05:52:38

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: [Solved, I am an idiot] Can only connect to ssh listening on port 22

Running a slice myself here, and the SSH port is non-standard too. Sshd is allowed in /etc/hosts.allow, but you can't specify ports there afaik, and /etc/services isn't modified.

/etc/services is for human reference. The hosts.{allow,deny} files work with the name of the executable, not with the type of service they provide, or the protocol's name.

Fukawi's firewall remark deserves looking into; a lot of companies will only allow certain outgoing ports (at my job only HTTP(S) is allowed for example, no SSH hmm).

Last edited by B (2009-03-31 05:53:53)


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#8 2009-03-31 21:07:46

Sjoden
Member
From: WA
Registered: 2007-08-16
Posts: 380
Website

Re: [Solved, I am an idiot] Can only connect to ssh listening on port 22

I feel so stupid. It was my firewall at work. I wasn't thinking, I figured that the firewall wouldn't care what traffic was running over ports 80 and 443, but I guess I was wrong. I tried the 'outside' dsl line we have and it worked fine. I just can't believe I had never tried to set this up at home, because it would have worked the first try.... I've never tried it on this dsl line because it's so slow, but oh well. Thanks for the replies.

Last edited by Sjoden (2009-03-31 21:10:38)

Offline

Board footer

Powered by FluxBB