You are not logged in.

#1 2008-07-31 01:17:06

void.pointer
Member
From: Dallas, TX
Registered: 2008-07-30
Posts: 239

Fresh install... can't SSH in through Putty

Hi,

I just now installed archlinux on my server machine, and for some reason I cannot connect to it via PuTTY on my windows machine. It's saying connection timed out. I did /etc/rc.d/sshd restart, and it seems to be started just fine. What do I need to do for this to work?

Offline

#2 2008-07-31 02:25:52

Peyton
Member
Registered: 2007-07-22
Posts: 36
Website

Re: Fresh install... can't SSH in through Putty

On the server, can you ssh to localhost?

Offline

#3 2008-07-31 02:30:29

void.pointer
Member
From: Dallas, TX
Registered: 2008-07-30
Posts: 239

Re: Fresh install... can't SSH in through Putty

I couldn't before. Doing netstat -ln had shown that it was listening on port 0.0.0.0. I played around with the sshd_config and found out that ListenAddress was set to 0.0.0.0. I set it to "*". Now I can reach it from localhost.

At the moment I don't even think my server is connected to the LAN. I went through the guide on the wiki here, however when I do netstat I'm not seeing sshd listening on any other port than loopback. How can I tell if I'm on the network? I set it up to use DHCP but I don't know how to see if it has an IP address.

This obviously means I still can't SSH in.

Offline

#4 2008-07-31 02:36:06

Peyton
Member
Registered: 2007-07-22
Posts: 36
Website

Re: Fresh install... can't SSH in through Putty

Run ifconfig.

Offline

#5 2008-07-31 02:52:40

void.pointer
Member
From: Dallas, TX
Registered: 2008-07-30
Posts: 239

Re: Fresh install... can't SSH in through Putty

Okay, so I am connected to the LAN. My IP address on the LAN is 192.168.10.150.

When I do this on my server:

ssh 192.168.10.150

I get a "Connection Refused" error message. Note that I do netstat and I do not see SSH listening on 192.168.10.150 port 22.

When I setup sshd_config to use "ListenAddress *", shouldn't that listen on both localhost & my LAN IP?

Last edited by void.pointer (2008-07-31 03:05:40)

Offline

#6 2008-07-31 03:15:57

Peyton
Member
Registered: 2007-07-22
Posts: 36
Website

Re: Fresh install... can't SSH in through Putty

Try commenting out ListenAddress.

Offline

#7 2008-07-31 03:30:18

void.pointer
Member
From: Dallas, TX
Registered: 2008-07-30
Posts: 239

Re: Fresh install... can't SSH in through Putty

Great, that works!

netstat shows that it's now listening on 0.0.0.0. Why is this? I'm not sure what this means. Can you explain? Why did ListenAddress * not work?

Also, I setup my hostname in rc.conf, however I cannot address my server by that hostname. What do I need to do to make this work? Do I need to edit /etc/hosts somehow? I'm not sure what /etc/hosts would be changed to since I'm using DHCP. Thanks again.

Offline

#8 2008-07-31 03:59:02

Peyton
Member
Registered: 2007-07-22
Posts: 36
Website

Re: Fresh install... can't SSH in through Putty

I don't think that using a wildcard there is valid, but I do know that the default behavior is to listen on all IPs. So, leaving the directive out will work.

You'll need to edit /etc/hosts with your hostname. A comment in rc.conf actually asks you to do this, although it's easy to overlook. I think that /etc/hosts has instructions within it, but the result should look like this:

127.0.0.1               localhost.localdomain   localhost  HostnameGoesHere

Last edited by Peyton (2008-07-31 04:36:59)

Offline

#9 2008-07-31 04:03:24

void.pointer
Member
From: Dallas, TX
Registered: 2008-07-30
Posts: 239

Re: Fresh install... can't SSH in through Putty

If it's listening on all IPs, I wouldn't see 0.0.0.0 in netstat right? Not sure what is going on...

I did actually see the comment in the rc.conf, but it confused me. It's making it look like I'm binding my server's hostname to 127.0.0.1. Do you understand the format of /etc/hosts? I don't know how you could possibly bind an IP to the server's domain name in the /etc/hosts file since I'm using DHCP. Is there some sort of wildcard I use?

Offline

#10 2008-07-31 04:06:18

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

Re: Fresh install... can't SSH in through Putty

You'll also need to adjust /etc/hosts.allow

Have you followed the Wiki for setting up OpenSSH?
http://wiki.archlinux.org/index.php/SSH … _others_in

Offline

#11 2008-07-31 04:08:09

void.pointer
Member
From: Dallas, TX
Registered: 2008-07-30
Posts: 239

Re: Fresh install... can't SSH in through Putty

fukawi2 wrote:

You'll also need to adjust /etc/hosts.allow

Have you followed the Wiki for setting up OpenSSH?
http://wiki.archlinux.org/index.php/SSH … _others_in

Thanks for your reply.

Yes, I did read that article but as you can see I ran into some unexpected problems. I already had my hosts.allow file set to ALL. SSH works fine at this point, I just need to get my domain name working.

UPDATE:

I found this article on the internet just now and it explains how the hosts file must be modified if using DHCP. The syntax seems rather obscure, unobvious, confusing, and mostly hacky. Can anyone explain the weird syntax? It looks like the IP address 127.0.0.1 is being assigned to the hostname itself as well as the "localhost" name.

Last edited by void.pointer (2008-07-31 04:12:30)

Offline

#12 2008-07-31 04:26:13

Peyton
Member
Registered: 2007-07-22
Posts: 36
Website

Re: Fresh install... can't SSH in through Putty

Well, you can associate multiple aliases with a single address. I use DHCP as well, though, and my hosts file is as posted above, except, of course, with a different hostname.

I'm really not sure why things aren't working for you if you have the hostname set in rc.conf. Running hostname -a returns the hostname, correct?

EDIT: Fixed error in /etc/hosts above, adding localhost.

Last edited by Peyton (2008-07-31 04:37:38)

Offline

#13 2008-07-31 04:37:04

void.pointer
Member
From: Dallas, TX
Registered: 2008-07-30
Posts: 239

Re: Fresh install... can't SSH in through Putty

My hosts file:

#
# /etc/hosts: static lookup table for host names
#

#<ip-address>   <hostname.domain.org>   <hostname>
127.0.0.1       server.foo.com localhost.localdomain    localhost server

# End of file

And "hostname -a" returns:

[root@server /]# hostname -a
localhost.localdomain localhost server

And when I do a "ping server", I get:

[root@server /]# ping server
PING server.foo.com (127.0.0.1) 56(84) bytes of data.
64 bytes from server.foo.com (127.0.0.1): icmp_seq=1 ttl=64 time=0.034 ms
64 bytes from server.foo.com (127.0.0.1): icmp_seq=2 ttl=64 time=0.017 ms
64 bytes from server.foo.com (127.0.0.1): icmp_seq=3 ttl=64 time=0.017 ms
64 bytes from server.foo.com (127.0.0.1): icmp_seq=4 ttl=64 time=0.016 ms
64 bytes from server.foo.com (127.0.0.1): icmp_seq=5 ttl=64 time=0.017 ms

See? it's mapped to localhost...

Offline

#14 2008-07-31 04:40:34

Peyton
Member
Registered: 2007-07-22
Posts: 36
Website

Re: Fresh install... can't SSH in through Putty

Can you access your main computer from the server by hostname?

Offline

#15 2008-07-31 04:46:40

void.pointer
Member
From: Dallas, TX
Registered: 2008-07-30
Posts: 239

Re: Fresh install... can't SSH in through Putty

You're asking if my linux server can ping my windows machine? Well, I'm not sure what hostname to use. I'm part of a workgroup named "workgroup" and my windows machine's name is "lmfao". The system dialog says my full computer name is "lmfao." (with a dot at the end), so when I try to ping that via:

ping lmfao.

I get:

[root@server /]# ping lmfao.
PING lmfao (63.251.179.13) 56(84) bytes of data.

This isn't even remotely correct. I have no idea where that IP address is coming from. Whatever it is, it isn't capable of being pinged. My answer to your question I guess is no.

UPDATE:
I can ping my router, which does use a hostname. My router's hostname is "router", and I can do "ping router" and it works.

Last edited by void.pointer (2008-07-31 05:13:51)

Offline

Board footer

Powered by FluxBB