# ssh server partially works



## vigilant (Feb 17, 2009)

to be honest i have 2 problems to solve: 

im creating an ftp server that has ubuntu intrepid on it. my laptop is FreeBSD 7.1 i can only connect locally when im on my wireless network. i installed an ssh client to my cellphone. it wont connect to the server. the phone is an samsung blackjack with windows mobile. i have a windows xp partition of the bsd computer and i have a centos computer for my local server. i booted back into windows and tested openssh and was able to connect ONLY WHEN I WAS ON WIFI. when turned off the card and connected the phone as modem i am unable to acess the server.

the ubuntu server is however connected to the wifi network and able to acess the web. so my two questions are

1) how do i make it so i can ssh to this server from my school?
2) in order to ssh from school i need to be able to tether my samsung blackjack to my BSD laptop since thats what i normally use so i can get internet otherwise ill have buy a usb modem and they not cheap.

i also had edited my hosts file in /etc/hosts in ubuntu to get the server running under my boss suggestion i thing may have been uneeded. could that be the problem?


----------



## trev (Feb 17, 2009)

Define "i am unable to access the server". What happens? What are the error messages? What happens if you throw in a few -vv to ssh?


----------



## vigilant (Feb 17, 2009)

what happens is if im connecting from abroad or attempting to ssh thru my phone it says connection timed out. i have not tried ssh -vv im gonna look into that now.


----------



## anomie (Feb 17, 2009)

vigilant said:
			
		

> im creating an ftp server that has ubuntu intrepid on it. my laptop is FreeBSD 7.1 i can only connect locally when im on my wireless network. i installed an ssh client to my cellphone. it wont connect to the server. the phone is an samsung blackjack with windows mobile. i have a windows xp partition of the bsd computer and i have a centos computer for my local server. i booted back into windows and tested openssh and was able to connect ONLY WHEN I WAS ON WIFI. when turned off the card and connected the phone as modem i am unable to acess the server.



There are a few dozen different things that can cause the symptoms you're describing. My first question is: is your Ubuntu server sitting behind a NAT device (on private IP space) at your home? 

From the Ubuntu box, let's see the output produced by the following: 

 `% /sbin/ifconfig`
 `% netstat -ltn | grep '22'`

Also, post the exact ssh client command you're using.


----------



## vigilant (Feb 17, 2009)

arumator@ubuntu:~$ sudo /sbin/ifconfig
[sudo] password for arumator: 
\eth0      Link encap:Ethernet  HWaddr 00:1f:a7:6c:1c:8e  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:51 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:21848 errors:0 dropped:0 overruns:0 frame:0
          TX packets:21848 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1272432 (1.2 MB)  TX bytes:1272432 (1.2 MB)

wlan0     Link encap:Ethernet  HWaddr 00:1f:a7:6c:1c:8e  
          inet addr:192.168.1.109  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::21f:a7ff:fe6c:1c8e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1039863 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1084446 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:885615660 (885.6 MB)  TX bytes:769937536 (769.9 MB)

arumator@ubuntu:~$ sudo netstat -ltn | grep '22'
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN     
tcp6       0      0 :::22                   :::*                    LISTEN     
arumator@ubuntu:~$ 

my server is open ssh server and i just checked to make sure that the server package is installed and it is. the client is also installed.


----------



## anomie (Feb 18, 2009)

192.168.1.109/24 is a host on a private network. 

You're going to need to configure your router/switch/NAT device to forward requests from the 'net to tcp port 22 on its external interface to your internal server.


----------



## vigilant (Feb 19, 2009)

sorry i havent been able to reply to this  i was in bed all day. i had my brother send ports 22 and 24 to me and i still couldnt connenct if i switched off my wifi card and used my cell as a usb modem with windows amd i  get the same error: connection timed out.

he said it probaly wouldnt work becuase i need to set a static ip. last time i tried that though i was unable to connect to server at all.


----------



## vigilant (Feb 19, 2009)

since i dont know where the edit button is my brother is out of town anfd hes our family's router admin.


----------



## anomie (Feb 19, 2009)

Please read the private network article so that you understand what you're dealing with here. From the 'net you're going to have to connect to the router/NAT device's _external_ (i.e. publicly routable) interface. 

You could use one of the free "dynamic dns" services (e.g. DynDNS) so that you won't have to keep checking if the IP has changed, but that's perhaps another thread.


----------

