maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   ssh to N900 fails (https://talk.maemo.org/showthread.php?t=43638)

joschum 2010-02-07 13:32

ssh to N900 fails
 
Hi,

I am trying to ssh into my Nokia N900 but it fails. I set up usb0 and made sure that wireless is turned on:

Trying to access the N900 from my laptop I get the following message:

Code:

schm@epithalamus:~$ ssh root@192.168.254.219
ssh: connect to host 192.168.254.219 port 22: No route to host

The same happens when trying to access it via USB:

Code:

schm@epithalamus:~$ ssh root@192.168.2.15
ssh: connect to host 192.168.2.15 port 22: No route to host

Any ideas how to fix this?
joschum

hawaii 2010-02-07 14:49

Re: ssh to N900 fails
 
I am actually experiencing this also.

I have verified SSHd is running, confirmed the IP address of the N900 on my WLAN, and also confirmed connectivity. I can get a secure shell on the N900 from loopback, localhost and the internal LAN address when SSH'ing directly on the device.

I just can't hit it from any other machine. I am running down ssh configs right now to see if anything randomly changed.

flya320 2010-02-07 14:50

Re: ssh to N900 fails
 
looks like a problem with your ip address setup / routing

on your n900 issue the following commands as root and post the output:

cat /etc/ssh/sshd_config
route
ifconfig -a

on your computer from which you are trying to connect, issue:

ifconfig -a
route, or route print, or ip route show

b666m 2010-02-07 14:53

Re: ssh to N900 fails
 
try (while connected to the phone)

ifconfig usb0 down
ifconfig usb0 up

then try to ssh in again

hawaii 2010-02-07 14:55

Re: ssh to N900 fails
 
For some reason I am experiencing decay on WiFi. I open a constant ping session on the N900 to my workstation, and everything works fine.

joschum 2010-02-08 09:37

Re: ssh to N900 fails
 
Quote:

Originally Posted by flya320 (Post 514369)
looks like a problem with your ip address setup / routing

on your n900 issue the following commands as root and post the output:

cat /etc/ssh/sshd_config
route
ifconfig -a

on your computer from which you are trying to connect, issue:

ifconfig -a
route, or route print, or ip route show

OK, here is the output of

cat /etc/ssh/sshd_config

Code:

# Package generated configuration file
# See the sshd(8) manpage for details

# What ports, IPs and protocols we listen for
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes

# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 768

# Logging
SyslogFacility AUTH
LogLevel INFO

# Authentication:
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes

RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile        %h/.ssh/authorized_keys

# Don't read the user's ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes

# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no

# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no

# Change to no to disable tunnelled clear text passwords
#PasswordAuthentication yes

# Kerberos options
#KerberosAuthentication no
#KerberosGetAFSToken no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes

X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no

#MaxStartups 10:30:60
#Banner /etc/issue.net

# Allow client to pass locale environment variables
AcceptEnv LANG LC_*

Subsystem sftp /usr/lib/openssh/sftp-server

#UsePAM yes

And this is the output of route:

Code:

Kernel IP routing table
Destination    Gateway        Genmask        Flags Metric Ref    Use Iface
192.168.254.0  *              255.255.255.0  U    0      0        0 wlan0
default        192.168.254.1  0.0.0.0        UG    0      0        0 wlan0

Output of
ifconfig -a

Code:

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:92 errors:0 dropped:0 overruns:0 frame:0
          TX packets:92 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:12609 (12.3 KiB)  TX bytes:12609 (12.3 KiB)

phonet0  Link encap:UNSPEC  HWaddr 15-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 
          UP POINTOPOINT RUNNING NOARP  MTU:4000  Metric:1
          RX packets:7120 errors:0 dropped:0 overruns:0 frame:0
          TX packets:187 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:152828 (149.2 KiB)  TX bytes:3334 (3.2 KiB)

upnlink0  Link encap:UNSPEC  HWaddr 1B-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 
          UP POINTOPOINT RUNNING NOARP  MTU:49152  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:1
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

usb0      Link encap:Ethernet  HWaddr 36:F6:2A:9E:74:0F 
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:11 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:388 (388.0 B)  TX bytes:0 (0.0 B)

wlan0    Link encap:Ethernet  HWaddr A8:7B:39:DC:87:B6 
          inet addr:192.168.254.219  Bcast:192.168.254.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:887 errors:0 dropped:0 overruns:0 frame:0
          TX packets:811 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:510308 (498.3 KiB)  TX bytes:166707 (162.7 KiB)

wmaster0  Link encap:UNSPEC  HWaddr 00-1F-DF-A8-3C-E4-00-00-00-00-00-00-00-00-00-00 
          UP BROADCAST RUNNING 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)

On my laptop computer the output of
ifconfig -a
gives:

Code:

eth0      Link encap:Ethernet  HWaddr 00:22:68:0c:62:fb 
          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)
          Memory:f0600000-f0620000

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:362 errors:0 dropped:0 overruns:0 frame:0
          TX packets:362 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:98323 (98.3 KB)  TX bytes:98323 (98.3 KB)

usb0      Link encap:Ethernet  HWaddr 02:80:37:ec:02:00 
          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)

vmnet1    Link encap:Ethernet  HWaddr 00:50:56:c0:00:01 
          inet addr:192.168.177.1  Bcast:192.168.177.255  Mask:255.255.255.0
          inet6 addr: fe80::250:56ff:fec0:1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:50 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

vmnet8    Link encap:Ethernet  HWaddr 00:50:56:c0:00:08 
          inet addr:172.16.23.1  Bcast:172.16.23.255  Mask:255.255.255.0
          inet6 addr: fe80::250:56ff:fec0:8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:50 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0    Link encap:Ethernet  HWaddr 00:21:6a:1e:92:86 
          inet addr:192.168.254.222  Bcast:192.168.254.255  Mask:255.255.255.0
          inet6 addr: fe80::221:6aff:fe1e:9286/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:25628 errors:0 dropped:0 overruns:0 frame:0
          TX packets:20439 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:23174401 (23.1 MB)  TX bytes:5773662 (5.7 MB)

wmaster0  Link encap:UNSPEC  HWaddr 00-21-6A-1E-92-86-00-00-00-00-00-00-00-00-00-00 
          UP RUNNING  MTU:0  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)

Is this a problem with my routing table?

SubCore 2010-02-08 10:50

Re: ssh to N900 fails
 
Quote:

Originally Posted by joschum (Post 515833)
Is this a problem with my routing table?

first of all it's a problem with your usb0 interfaces :)

neither has an IP address configured, your "/etc/network/interfaces" is probably missing some bits.
once both interfaces have the correct IPs (192.168.2.14 and .15), the routing table should be updated automatically.

Blackbeard 2010-02-08 11:00

Re: ssh to N900 fails
 
When trying to log in over wireless I suggest to check how close to access point your N900 is. Once I moved my phone to the other side of the room my troubles went away. I think N900 is somewhat susceptible to near field problems.

joschum 2010-02-08 12:00

Re: ssh to N900 fails
 
Quote:

Originally Posted by SubCore (Post 515920)
first of all it's a problem with your usb0 interfaces :)

neither has an IP address configured, your "/etc/network/interfaces" is probably missing some bits.
once both interfaces have the correct IPs (192.168.2.14 and .15), the routing table should be updated automatically.

Yes, usb0 seems to be disconnected but ssh to the N900 via wireless by
ssh root@192.168.254.219
should work since both the laptop and the N900 are in the same subnet. I also moved the N900 close to the access point but it doesn`t work. ssh from the N900 to another computer works.
Any ideas?

Rob1n 2010-02-08 12:05

Re: ssh to N900 fails
 
Is the routing table on your laptop correct?

Crotch 2010-02-08 12:17

Re: ssh to N900 fails
 
I have a similar problem that I can "work" around.

The first couple of times I try to ssh over wireless I get the same message as joschum. However, I try to connect several times. After about 5 times it connects and works flawlessly.

kwotski 2010-02-08 12:28

Re: ssh to N900 fails
 
It seems quite odd, because for both wlan interfaces, the subnet is correct and there is traffic both ways.

So, on the N900:

inet addr:192.168.254.219
Mask:255.255.255.0
RX bytes:510308 (498.3 KiB) TX bytes:166707 (162.7 KiB)

(though the traffic is rather low here)

and on the laptop:

inet addr:192.168.254.222
Mask:255.255.255.0
RX bytes:23174401 (23.1 MB) TX bytes:5773662 (5.7 MB)


These are definitely correctly configured at the interface level.

I've occasionally had an issue ssh-ing into the N900 where the N900's lan interface needs to be "woken up" by initiating some traffic from the device itself.

"No route to host" might be a connect timeout, if the wlan interface on the N900 has gone to sleep (the message might take a while to appear if this is the case.)

I would first make sure there's no interference from iptables on the laptop by turning iptables off temporarily, then make sure the interfaces and routing are as described previously on both machines, then try pinging the laptop IP from the N900, and if you get replies, try to ssh to the N900 from the laptop again.

If that doesn't work, might be best to post your laptop routing table, though from looking at the ifconfig output it seems it would be correct.

mece 2010-02-08 12:33

Re: ssh to N900 fails
 
Wow, all sorts of complicated stuff in this thread. Pinging the computer from the N900 works for me when I get that. I think it has to do with power saving

flya320 2010-02-08 12:53

Re: ssh to N900 fails
 
Quote:

Originally Posted by joschum (Post 516053)
Yes, usb0 seems to be disconnected but ssh to the N900 via wireless by
ssh root@192.168.254.219
should work since both the laptop and the N900 are in the same subnet. I also moved the N900 close to the access point but it doesn`t work. ssh from the N900 to another computer works.
Any ideas?

Have a look at the routing table of your laptop, I still think it is a routing problem.

Are you able to ping the n990 from laptop?
Are you able to ping laptop from n900?

Are you able to ssh from n900 to laptop?

What does telnet 192.168.254.219 22 give you?

joschum 2010-02-08 12:59

Re: ssh to N900 fails
 
Quote:

Originally Posted by Rob1n (Post 516066)
Is the routing table on your laptop correct?

This is the routing table of my laptop, is this OK?
Code:

root@epithalamus:~# route -n
Kernel IP routing table
Destination    Gateway        Genmask        Flags Metric Ref    Use Iface
172.16.23.0    0.0.0.0        255.255.255.0  U    0      0        0 vmnet8
192.168.177.0  0.0.0.0        255.255.255.0  U    0      0        0 vmnet1
192.168.254.0  0.0.0.0        255.255.255.0  U    2      0        0 wlan0
169.254.0.0    0.0.0.0        255.255.0.0    U    1000  0        0 wlan0
0.0.0.0        192.168.254.1  0.0.0.0        UG    0      0        0 wlan0


SubCore 2010-02-08 13:04

Re: ssh to N900 fails
 
Quote:

Originally Posted by joschum (Post 516152)
This is the routing table of my laptop, is this OK?

hm, that's strange. your default route points to "tun0", yet your previous ifconfig output doesn't list tun0 as interface.

do you use OpenVPN on your laptop? maybe your setup scripts for the encrypted tunnel didn't restore the original settings properly after disconnecting?

pycage 2010-02-08 13:10

Re: ssh to N900 fails
 
It could be a powersaving issue (I have this with my router in all N900 firmwares since 38.x except for 42-11). Ping the router from your N900 or do some other network traffic to make the router see the N900 again, so that you can ssh into it.
Setting down powersaving by one level helps, too (at the expense of battery life).

joschum 2010-02-08 13:10

Re: ssh to N900 fails
 
Quote:

Originally Posted by SubCore (Post 516160)
hm, that's strange. your default route points to "tun0", yet your previous ifconfig output doesn't list tun0 as interface.

do you use OpenVPN on your laptop? maybe your setup scripts for the encrypted tunnel didn't restore the original settings properly after disconnecting?

Oh, I pasted an output of route -n that was generated during a VPN session. Now the output above is corrected, it does not contain tun0 anymore...

SubCore 2010-02-08 13:21

Re: ssh to N900 fails
 
Quote:

Originally Posted by joschum (Post 516172)
Now the output above is corrected, it does not contain tun0 anymore...

hm looks good now... it should work :/

the only thing i can think of now is that maybe the vmware network module messes up the other interfaces. i've seen that happen sometimes...

joschum 2010-02-09 07:02

Re: ssh to N900 fails
 
I followed the steps that are described in the link below, now USB networking works fine for me. That is, ssh from my laptop running Ubuntu 9.10 to the N900 works :-)

http://wiki.maemo.org/N900_USB_Networking

Crogge 2010-02-11 04:58

Re: ssh to N900 fails
 
I have also a problem to connect per SSH to my N900 over WLAN. Yes, I have installed the OpenSSH Client+Server.

This are the things which I tested already:

- I can't ping the phone at all, simply no response
- I can ping my notebook / servers from the phone
- I can connect with UltraVNC to the phone and use it
- The SSH client on the phone work's fine and connect's for example to my servers

I simply get a timeout when I try to connect to my phone on port 22 per SSH. Any idea's?

SubCore 2010-02-11 11:06

Re: ssh to N900 fails
 
the phone doesn't respond to pings, so that's expected.

make sure the ssh daemon is running - type in xterm:
Code:

ps aux | grep ssh
you should get a line containing "sshd" and ":22" somewhere. if not, your daemon isn't running, and you can start it by rebooting the device or by issuing
Code:

sudo gainroot
initctl sshd start


Crogge 2010-02-11 20:17

Re: ssh to N900 fails
 
Quote:

Originally Posted by SubCore (Post 520959)
the phone doesn't respond to pings, so that's expected.

make sure the ssh daemon is running - type in xterm:
Code:

ps aux | grep ssh
you should get a line containing "sshd" and ":22" somewhere. if not, your daemon isn't running, and you can start it by rebooting the device or by issuing
Code:

sudo gainroot
initctl sshd start


Well it says "5131 root 3884 S /usr/sbin/sshd -D" so it seems to be ok?

It is "initctl start sshd" by the way, I restarted it but I still can't connect.

SubCore 2010-02-11 20:30

Re: ssh to N900 fails
 
Quote:

Originally Posted by Crogge (Post 521841)
Well it says "5131 root 3884 S /usr/sbin/sshd -D" so it seems to be ok?

yes, seems ok.
now try
Code:

netstat -pan | grep ssh
that lists network connections / listeners, and that's where you should find a line with ":22", indicating that sshd listens on port 22 (sorry that i wrote :22 should be seen with ps aux :) )

then you can try
Code:

ssh root@127.0.0.1
on the device to check if local connections work.

if local connections work but you still can't connect from your laptop/pc, then we'll have to install sysklogd and enable logging for ssh.

Crogge 2010-02-11 23:06

Re: ssh to N900 fails
 
Quote:

Originally Posted by SubCore (Post 521863)
yes, seems ok.
now try
Code:

netstat -pan | grep ssh
that lists network connections / listeners, and that's where you should find a line with ":22", indicating that sshd listens on port 22 (sorry that i wrote :22 should be seen with ps aux :) )

then you can try
Code:

ssh root@127.0.0.1
on the device to check if local connections work.

if local connections work but you still can't connect from your laptop/pc, then we'll have to install sysklogd and enable logging for ssh.

Thank you for your fast response!

I used "netstat -a | grep ssh" because -pan / -p didn't work. It display the following informations:

tcp 0 0 0.0.0.0:ssh 0.0.0.0:* LISTEN

netstat: no kernel support for AF INET6 (tcp)
netstat: no kernel support for AF INET6 (udp)
netstat: no kernel support for AF INET6 (raw)

Connecting locally to the SSH server from the N900 itself worked fine.

SubCore 2010-02-12 00:01

Re: ssh to N900 fails
 
Quote:

Originally Posted by Crogge (Post 522088)
tcp 0 0 0.0.0.0:ssh 0.0.0.0:* LISTEN

hehe sorry i'm used to certain parameters i use on desktop / server systems all the time. -pan is one of them :)

":ssh" is equal to the ":22" i was talking about, the -n parameter for netstat should trigger the display of port numbers instead service names.
anyhow...

do you have some sort of firewall configured which may be blocking port 22 on your wlan?
you could try to change the port on which sshd listens:

Code:

sudo gainroot
cd /etc/ssh
cp sshd_config sshd_config.bak
cat sshd_config.bak | sed 's/Port 22/Port 2022/' > sshd_config
initctl stop sshd
initctl start sshd

with these commands, you create a backup file of your current config, and then use the tool "sed" to change the value for Port from 22 to 2022.
(or you edit the file sshd_config some other way, with vim f.ex.).

now you can try connecting to the device using the new port:
Code:

ssh -p 2022 root@n900.ip

Crogge 2010-02-12 00:43

Re: ssh to N900 fails
 
Quote:

Originally Posted by SubCore (Post 522177)
hehe sorry i'm used to certain parameters i use on desktop / server systems all the time. -pan is one of them :)

":ssh" is equal to the ":22" i was talking about, the -n parameter for netstat should trigger the display of port numbers instead service names.
anyhow...

do you have some sort of firewall configured which may be blocking port 22 on your wlan?
you could try to change the port on which sshd listens:

Code:

sudo gainroot
cd /etc/ssh
cp sshd_config sshd_config.bak
cat sshd_config.bak | sed 's/Port 22/Port 2022/' > sshd_config
initctl stop sshd
initctl start sshd

with these commands, you create a backup file of your current config, and then use the tool "sed" to change the value for Port from 22 to 2022.
(or you edit the file sshd_config some other way, with vim f.ex.).

now you can try connecting to the device using the new port:
Code:

ssh -p 2022 root@n900.ip

I have set the SSH server to port "2222" and restarted it, I can connect locally just fine on port 2222 with SSH. But I still can't connect per WLAN or GPRS to SSH, only VNC works perfectly.

I tested already another SSH client and my notebook, even my N95 to be sure that the problem is not on the client side. That displayed the following error "Host unreachable (-191)".

Any idea why the SSH server accepts only local connections?

Venomrush 2010-02-12 00:49

Re: ssh to N900 fails
 
I fixed mine by rebooting the router, try that.

SubCore 2010-02-12 00:59

Re: ssh to N900 fails
 
Quote:

Originally Posted by Crogge (Post 522247)
Any idea why the SSH server accepts only local connections?

not really...
"0.0.0.0:ssh" from the netstat output indicates that it's listening on all interfaces, and the N900 doesn't have a firewall or similar.

and i don't think it's actually the ssh daemon. a timeout usually is due to a networking problem.
but you say VNC works, so the network should be ok...

you can verify that by enabling logging for the ssh daemon, i've described how to do that here. if you don't see any events there while connecting, you have a problem elsewhere.

btw, connecting to the N900 when it's on gprs is a whole different story, because you don't get a public IP for direct access.

SubCore 2010-02-12 01:02

Re: ssh to N900 fails
 
Quote:

Originally Posted by Crogge (Post 522247)
I tested already another SSH client and my notebook, even my N95 to be sure that the problem is not on the client side. That displayed the following error "Host unreachable (-191)".

could you describe your network setup in more detail?
your notebook and the N900 are both on the same wlan? which software do you use, which OS? do you connect to the N900's ip or hostname? (what do you use for the VNC connection?)

Crogge 2010-02-12 01:18

Re: ssh to N900 fails
 
I checked already the router but as I said I use SSH in the LAN/WAN also on custom ports and never had any issues.

Indeed it seems to be a network problem, I followed your log tutorial and look at the logs at the moment. Simply nothing happens at all when I try to connect with SSH but it looks ok when I connect on the phone itself on a second console.

I have a simply LAN network here, my notebook is connected per LAN and my N900 is connected per WLAN to a router. I use on the notebook itself Windows XP and Putty for SSH connections. As I said I also tested If I can connect from my N95 but got a timeout as result, it works fine to other SSH server's from both devices.

The only application which works always fine is UltraVNC on port 5900. I simply use the N900 IP (192.168.10.114).

SubCore 2010-02-12 10:30

Re: ssh to N900 fails
 
Quote:

Originally Posted by Crogge (Post 522290)
As I said I also tested If I can connect from my N95 but got a timeout as result, it works fine to other SSH server's from both devices.

other SSH servers on the same network or on the internet?
if you have never connected to an SSH server on the wlan, maybe your router (or the windows xp firewall) is really blocking that?
are your lan and the wlan in the same subnet?

the next step would be to use some network monitoring software on the laptop and/or your router. maybe that'll give some hints...
try to compare what happens when you use ultravnc and when you use ssh.

other than that, i'm at a loss, sorry... :o

taril 2010-02-17 12:05

Re: ssh to N900 fails
 
how can i make it work if my n900 is on gprs internet?
I cannot connet to my device in this case, Connection timeout

SubCore 2010-02-17 12:23

Re: ssh to N900 fails
 
Quote:

Originally Posted by taril (Post 531963)
how can i make it work if my n900 is on gprs internet?
I cannot connet to my device in this case, Connection timeout

this will not work.

when you are online over gprs, you don't really have a public IP. you get a private IP inside your carrier's network, and every connection to the outside is "masked" with the carrier's public IP. hence many, many devices appear to have the same public IP.

the only way to make it work over gprs (other than signing an enterprise-level contract with your carrier to get a real public IP) is to set up some sort of virtual private network (VPN) to a trusted network. then you could access the device directly from that trusted network.

Crogge 2010-02-23 04:41

Re: ssh to N900 fails
 
Quote:

Originally Posted by SubCore (Post 522738)
other SSH servers on the same network or on the internet?
if you have never connected to an SSH server on the wlan, maybe your router (or the windows xp firewall) is really blocking that?
are your lan and the wlan in the same subnet?

the next step would be to use some network monitoring software on the laptop and/or your router. maybe that'll give some hints...
try to compare what happens when you use ultravnc and when you use ssh.

other than that, i'm at a loss, sorry... :o

Well it is defiantly my router and I have no idea why because there are several other SSH machines in the network, the N900 is the only one which gets blocked. Its a Netgear WNR2000 router by the way.

I tested it via ad hoc and it worked fine, its really way easier to use the console via SSH then on the small N900 keyboard.

Scottlfa 2010-02-23 04:48

Re: ssh to N900 fails
 
mine works fine. openssh client and server ... run from the terminal with full path.

propelli 2010-02-24 20:54

Re: ssh to N900 fails
 
Quote:

Originally Posted by SubCore (Post 531996)
this will not work.

when you are online over gprs, you don't really have a public IP. you get a private IP inside your carrier's network, and every connection to the outside is "masked" with the carrier's public IP. hence many, many devices appear to have the same public IP.

the only way to make it work over gprs (other than signing an enterprise-level contract with your carrier to get a real public IP) is to set up some sort of virtual private network (VPN) to a trusted network. then you could access the device directly from that trusted network.

This might not be an answer to the original problem, but there is a simple way to connect to your n900 over gprs if your ssh server has a fixed public ip address.
By opening a reverse tunnel from n900 to the ssh server you can connect to n900 via that tunnel:

on n900 do:

ssh -R localhost:2222:localhost:22 username@server.ip

on the server do:

ssh -p 2222 root@localhost

This method of connecting to n900 with ssh works on wlan/lan also.

propelli

ogre 2010-03-09 07:40

Re: ssh to N900 fails
 
Perhaps i can shed some light on problems connecting SSH to the n900.

Step 1. Simply enable the extras repository and install openSSH client and server. You can check SSH is now running by using 'ps -ef |grep ssh'

Step 2. try simply ssh root@<lanIP> from another device on the same subnet.....Note: in most cases this will NOT work, even though SSH is set up.

The reason this doesnt work is the way the n900 conserves wifi power and doesnt 'keep alive' the wifi connection

3. From the terminal on the n900, try 'ssh root@127.0.0.1'. Note: in many cases 'localhost' will not resolve so no point using that.

4. if the n900 cant ssh to itself you have an additional problem, but if it does work then all is normal.

5. set the n900 to ping the router.

6. ssh to the n900. the 'pings' keep the wifi alive and you should have no problem getting in

irah 2010-04-12 04:38

Re: ssh to N900 fails
 
I have experienced the same problem, and sometimes I could get through, but the connection was really really slow/laggish and would disconnect after a few minutes.

The problem is not in the SSH server because I can SSH to the device from itself. Also I can ping from the device but I cannot ping the device from outside. Also nmap won't find my maemo at all.

I got mine working by opening the browser on maemo side, now the connection works and stays stabile. Pinging the router/other machine didn't work.

Does the browser do something to the interfaces / routing rules?

sashabe 2011-05-28 05:59

Re: ssh to N900 fails
 
I had this problem with OSX (Cyberduck) not connecting to via Asus WL-520GU router, and it got fixed by setting up 'Virtual server' tab in router settings as Port Range:22, Local IP:[N900 local IP], Local Port:22 and turning power save of the WiFi Network on N900 itself off, otherwise N900 couldn't be pinged from outside (and SSH to the device worked only when pinging FROM N900). On my other configuration with another Asus router, WL-500GP, things always were good. But that configuration has got a fixed IP, whereas this one has not.


All times are GMT. The time now is 11:59.

vBulletin® Version 3.8.8