maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   please help with ssh (https://talk.maemo.org/showthread.php?t=65293)

thesnake505 2010-11-08 17:30

please help with ssh
 
hay guys, i need to connect my n900 to my win7 64bit laptop, i have had the n900 since januery and never used ssh, and decided its time to learn, how ever i cant seam to find any walk throus or guides so im after some help,

i have downloaded winscp on to my laptop and
openssh client and server on to the n900

but dont know what to do next lol?

thanks for any help snake

noobmonkey 2010-11-08 17:59

Re: please help with ssh
 
First you need to either know the root password or you need to set the password for another user.

(Installing ssh on the device forces you to change it anyway!)

Then get your devices ip (i am using wireless) - In terminal type
Code:

ifconfig
and press enter
http://content.screencast.com/users/...11-08_1759.png
In the result you will get something that looks like the IP.

One you know that complete the winscp screen like this:
http://content.screencast.com/users/...11-08_1755.png
Click Login
http://content.screencast.com/users/...11-08_1757.png
Enter the root password!
(Done!)


If you the login box stalls, try connecting to a website, anyone on your n900, and either wait or rety it - sometimes the n900 just needs a wake up ;)

paai 2010-11-08 18:08

Re: please help with ssh
 
Caveats and hints:

You cannot login from another host into your N900 when using GPRS, at least not if it uses ppp. A lan connection (generally 192.168.x.x) will do fine.

You must setup a connection from the N900 to your lan first.

You can login as user@192.168.x.x; which does not need changes to

sshd.conf. root login is a no-no and should be disabled by default.

Paai

PS: There is a widget that displays your IP number on the N900 desktop.

thesnake505 2010-11-08 18:20

Re: please help with ssh
 
Quote:

Originally Posted by noobmonkey (Post 867168)
First you need to either know the root password or you need to set the password for another user.

(Installing ssh on the device forces you to change it anyway!)

Then get your devices ip (i am using wireless) - In terminal type
Code:

ifconfig
and press enter
http://content.screencast.com/users/...11-08_1759.png
In the result you will get something that looks like the IP.

One you know that complete the winscp screen like this:
http://content.screencast.com/users/...11-08_1755.png
Click Login
http://content.screencast.com/users/...11-08_1757.png
Enter the root password!
(Done!)


If you the login box stalls, try connecting to a website, anyone on your n900, and either wait or rety it - sometimes the n900 just needs a wake up ;)

thank you for your quick reply however soemthing isnt working heres what i have done

in terminal i have sudo gainroot
then ifconfig

found inet addr

types this in host name on winscp

put root as the user name

hit login

but nothing happens after this, your second screen shot does not apear

so then i uninstalled and reinstalled winscp, however this didnt solve the problem any ideas???

oh and btw both laptop and n900 can access the internet as normal

noobmonkey 2010-11-08 18:24

Re: please help with ssh
 
In your N900 status bar thingy at the top do you have a button that says SSH Status? As that turns SSH on or OFF - it's off after each reboot etc for me, so i need to remember to turn it back on

edit - forgot to mention, that status bar things can scroll up and down too - so it may not always look like it is there.
Found googley image here
http://www.my-maemo.com/grafika/sshswitcher.jpg

thesnake505 2010-11-08 18:26

Re: please help with ssh
 
there is no option for ssh in my status bar!!! hmmmm that could be the problem

JonWW 2010-11-08 18:26

Re: please help with ssh
 
or... your IP address was wrong or a firewall on your PC is blocking WinSCP

noobmonkey 2010-11-08 18:28

Re: please help with ssh
 
:) possibly either of those too hehehe :P

noobmonkey 2010-11-08 18:29

Re: please help with ssh
 
Meh just found out thats not installed by default - no harm in having it though!

http://maemo.org/downloads/product/Maemo5/ssh-status/

kinggo 2010-11-08 18:30

Re: please help with ssh
 
but you also need password. When you were setting up SSH on N900 at some point you had to enter some password. That password you need to enter beside user name in winscp.
I'm using filezilla on ubuntu and everything went fine at very first attempt. I also set up fixed IP for my N900 and make a bookmark in filezilla so SSH is just a click away.

edit:

And of course, you have to turn SSH on on your N900. Either with applet (install separately) in your status bar or via terminal.

JonWW 2010-11-08 18:38

Re: please help with ssh
 
Quote:

Originally Posted by kinggo (Post 867210)
And of course, you have to turn SSH on on your N900. Either with applet (install separately) in your status bar or via terminal.

If you only install OpenSSH client/server, it is always on.

In Windows try pinging you phone, for example:
Code:

ping 192.168.0.4

jd4200 2010-11-08 18:38

Re: please help with ssh
 
Quote:

Originally Posted by noobmonkey (Post 867168)
First you need to either know the root password or you need to set the password for another user.

Would it not be best to login in as 'user', as any file you copy over (to the Linux partition) will be root owned?

thesnake505 2010-11-08 18:39

Re: please help with ssh
 
Quote:

Originally Posted by kinggo (Post 867210)
but you also need password. When you were setting up SSH on N900 at some point you had to enter some password. That password you need to enter beside user name in winscp.
I'm using filezilla on ubuntu and everything went fine at very first attempt. I also set up fixed IP for my N900 and make a bookmark in filezilla so SSH is just a click away.

edit:

And of course, you have to turn SSH on on your N900. Either with applet (install separately) in your status bar or via terminal.

ok, i have installed ssh status app noobmonkey put a lint to, i click it so it says ssh status:on

follow the procedure again, and winscp still just disapears, when i click login :-(


edit, also tried pinging my n900 and got this reply

C:\Users\martyn>ping 192.168.2.2

Pinging 192.168.2.2 with 32 bytes of data:
Reply from 192.168.2.6: Destination host unreachable.
Reply from 192.168.2.6: Destination host unreachable.
Reply from 192.168.2.6: Destination host unreachable.
Reply from 192.168.2.6: Destination host unreachable.

Ping statistics for 192.168.2.2:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss)

thesnake505 2010-11-08 18:47

Re: please help with ssh
 
tried ping again and got this

C:\Users\martyn>ping 192.168.2.2

Pinging 192.168.2.2 with 32 bytes of data:
Reply from 192.168.2.2: bytes=32 time=249ms TTL=64
Reply from 192.168.2.2: bytes=32 time=170ms TTL=64
Reply from 192.168.2.2: bytes=32 time=180ms TTL=64
Reply from 192.168.2.2: bytes=32 time=202ms TTL=64

Ping statistics for 192.168.2.2:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 170ms, Maximum = 249ms, Average = 200ms

however winscp still just shuts its self down

JonWW 2010-11-08 18:50

Re: please help with ssh
 
So you phone is reachable from you PC on 192.168.2.2 so something else is blocking WinSCP. Look at the PC's firewall.

noobmonkey 2010-11-08 18:52

Re: please help with ssh
 
ok, well, at least you are connecting now, even if a little slowly.
I do find winscp can't see the device if it's not awake so to speak....

on the device try pinging something else, or loading a website as you try conencting via winscp (I normally just have facebook on in the background, as it is an internet whore)...

The other thing, if you can, dicsonnect or turn of any pc firewalls etc, just to confirm it's not that.

thesnake505 2010-11-08 19:00

Re: please help with ssh
 
iv gota go to work now guy, will have to pick this up tomoro! cheers for your help today thou, will re post when i get home :D

adrianmilev 2010-11-08 19:04

Re: please help with ssh
 
I have the same problem as thesnake505 and solve it as "off" the firewall of windows7 while I made ssh session.

JonWW 2010-11-08 19:13

Re: please help with ssh
 
Quote:

Originally Posted by adrianmilev (Post 867258)
I have the same problem as thesnake505 and solve it as "off" the firewall of windows7 while I made ssh session.

Or you could edit the firewall settings (I don't have Win7 so cannot tell you where) and tell the firewall to always allow WinSCP.

paai 2010-11-09 06:07

Re: please help with ssh
 
Apart from winscp there is apso putty, that opens a ssh-terminal on your windows host. Try it.

If you can ping the N900 there probably is no firewall active.

Finally you can try 'telnet 192.168.2.2. 22' from the windows commandline to see if the N900 listens on the ssh port (22).

BTW: do you have a password for the 'user' acount on the N900? Perhaps winscp refuses to work if the password field id empty? You can remedy that with 'passwd user' from the n900 commandline.

Paai

thesnake505 2010-11-09 08:52

Re: please help with ssh
 
Quote:

Originally Posted by paai (Post 867744)
Apart from winscp there is apso putty, that opens a ssh-terminal on your windows host. Try it.

If you can ping the N900 there probably is no firewall active.

Finally you can try 'telnet 192.168.2.2. 22' from the windows commandline to see if the N900 listens on the ssh port (22).

BTW: do you have a password for the 'user' acount on the N900? Perhaps winscp refuses to work if the password field id empty? You can remedy that with 'passwd user' from the n900 commandline.

Paai

telnet isnot a recognise command in win 7 cmd!

not sure what u meant with passwd user from the n900?? when i installed openssh it asked for a password, have tried with and with out the password in the feild and also with user as the username!

will have a look at the other win7 ssh client u mention!

i do have ubuntu on this laptop, im guessing its worth a try using that, so could some one do me a quick quide to setting up ssh with ubuntu?

and i do appreciate all the help given :D

jd4200 2010-11-09 09:24

Re: please help with ssh
 
Quote:

Originally Posted by thesnake505 (Post 867846)
telnet isnot a recognise command in win 7 cmd!

not sure what u meant with passwd user from the n900?? when i installed openssh it asked for a password, have tried with and with out the password in the feild and also with user as the username!

The 'user' account (which is you) has no password by default, so you will not be able to login via SSH.
You need to set a password for it, by:

Open up the terminal, and as root type:
passwd user (note, passwd is not a typo).

Then you will be able to login as user, logining in as root via SSH is a bad idea.

paai 2010-11-09 11:40

Re: please help with ssh
 
snake:
first, check that the ssh daemon is running on your N900


$ ps ax | grep sshd

it should show someting like

897 ? Ss 0:00 /usr/sbin/sshd

Like jd4200 and myself already suggested: give yourself a password.

$ passwd user
New pasword for user:
retype password:

(Your name on the N900 is always 'user')

Install putty, run it
It will ask for hostname or ip-address. That will be 192.168.2.2
for you (BTW: you don't have a DHCP server that can assign different IP-numbers?)

A black window will appear with 'username' (that will be user) and 'password for user' (that will be the password you assigned to user).

jd4200 and I have already said that enabling root login and logging in as root is a Bad Idea (TM). I will say it again.

paai

thesnake505 2010-11-09 16:11

Re: please help with ssh
 
hay, mannaged to get a connection using putty which is cool so thanks all for that, i like the way it looks just like terminal x n the n900 :D
now i have a couple of questions, how do i transfer files using putty?

if nessacery with using putty can i login as root with sudo gain root???

cheers

JonWW 2010-11-09 16:49

Re: please help with ssh
 
You cannot transfer files using PuTTY as it just a Terminal window running on your phone. As you can access the N900 now, give WinSCP a try again.

When you login with PuTTY it asks you for a user name and password
User name:root
Password:The password you entered in the N900 when you installed OpenSSH

thesnake505 2010-11-09 17:03

Re: please help with ssh
 
winSCP is still not working, im now getting invalid access to memory every time i hit login!

paai 2010-11-10 07:46

Re: please help with ssh
 
There is a commandline counterpart to winscp, called PSCP. Download it from the same site as putty itself.

Your problems with winscp are worrying. Are you certain there is no virus in it? Run a viruscheck on your windows PC, delete winscp and install it again.

Paai

paai 2010-11-10 07:48

Re: please help with ssh
 
Quote:

Originally Posted by JonWW (Post 868226)

...

User name:root
Password:The password you entered in the N900 when you installed OpenSSH

Jon: please do not suggest to people to do ssh-logins as root. It is a major security hole.

Snake, if you changed sshd.conf to allow root logins, you'd better change it back.

Paai

paai 2010-11-10 07:54

Re: please help with ssh
 
Quote:

Originally Posted by thesnake505 (Post 868196)

...


if nessacery with using putty can i login as root with sudo gain root???

cheers

Yes, that is possible and much, much safer than allowing direct root login, which, (Grin, I feel I repeat myself) should be disabled...

But I gather that you are not very experienced with Linux, so understand that being root is an excellent opportunity to shoot yourself in both feet at the same time, so avoid it as much as possible.

Paai

famdango 2010-11-12 22:52

Re: please help with ssh
 
Quote:

Originally Posted by thesnake505 (Post 867219)
ok, i have installed ssh status app noobmonkey put a lint to, i click it so it says ssh status:on

follow the procedure again, and winscp still just disapears, when i click login :-(


edit, also tried pinging my n900 and got this reply

C:\Users\martyn>ping 192.168.2.2

Pinging 192.168.2.2 with 32 bytes of data:
Reply from 192.168.2.6: Destination host unreachable.
Reply from 192.168.2.6: Destination host unreachable.
Reply from 192.168.2.6: Destination host unreachable.
Reply from 192.168.2.6: Destination host unreachable.

Ping statistics for 192.168.2.2:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss)

I was having the same problem, where winscp just shut down at every login attempt. I opened TCP 22 port in windows firewall, and then whilst logging in to winscp, chose save instead of login. It saved the connection to user@192.168.2.4 and then connected straight up with no more problems..

slender 2010-11-12 22:57

Re: please help with ssh
 
IIRC N900 wifi goes "sleep"(if there is no data transfer) even-thought it seems to be connected. At least I have to first set SSH on and additionally open web-page on n900 or do something that involves data transfer. And after that I can connect to my n900 with winscp in my home network.

Larswad 2010-11-12 23:26

Re: please help with ssh
 
Honestly, putty and winscp are both good things for the poor windows user. But the full experience of secure shell can only be achieved between two linux machines, in my oppinoin. If you're stuck in Windows and want to gain access to another machine in a more complex way you might want to use cygwin, which is a more linux adapted environment. If you are even more stuck on "windows" in general NXServer/Client is something where you can get a fast desktop experience over a secure connection (that won't work with the N900 maemo though since afaik you cannot get the hildon over x11).

You can also if you're on a 3g or GSM connection and only is interested in the xterminal access to your n900 (and providing that you at home have a openssh server, probably under linux) use reverse ssh to gain access to your phone. But I won't explain it of course, it would be ridiculous since google is your friend. However, with reverse ssh I suggest you to make a bash script for that, and then aliases to access that script in a more compact way.

Rant over. Good night.

Scottlfa 2010-11-12 23:43

Re: please help with ssh
 
scp can be fun. I have been using ssh from the beginning though and its easy to setup.


All times are GMT. The time now is 17:00.

vBulletin® Version 3.8.8