| 1   2   | Next
maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   Full file system access via both USB and network using OpenSSH + WinSCP (https://talk.maemo.org/showthread.php?t=41422)

Bec 2010-01-19 21:22

Full file system access via both USB and network using OpenSSH + WinSCP
 
Get full access over your N900 file system in 3 easy steps!
Watch out what you replace or delete or you might end up with a bricked device!
! Always make a backup first ! ! Never edit files in "sudoers.d"!



A. Wi-Fi
Wireless router required!

1. Enable the maemo.org repository by simply clicking this link (you should have it by default if your device is updated)
(if you don't find the files requested below, the extras-testing repository too, manually by entering the details linked here into the app manager.

2. Install the following apps: Open SSH Client and Open SSH server on your N900.
  • be sure to enter a strong password that you'll remember for Open SSH!
    In case you forgot to enter a password or want to change it, install, ROOTSH, open terminal and type
    "sudo gainroot" [enter] "passwd" [enter] and you'll be prompted to change/enter the new password
  • you should also install the showIP widget for your desktop
3. Download WinSCP, a very nice free SSH client for windows and configure it as follows:

http://i50.tinypic.com/2m5ik1x.jpg

  • Host name: your N900 ip, get it from over here or install the showIP widget from app manger.
    -please remember that it may change on router/modem resets or because of your ISP
  • Port number: 22
  • User name: root
  • Password: a strong one - same as the one entered in Open SSH
  • Protocol: SFTP + SCP fallback


B. USB
Default cable is the only requirement!

1. Install Mad Developer (step A.1. may apply), run it and:
  • press "Manage USB" -> "Load g_either" -> "close".
  • enter the following IP: 192.168.1.30 -> "configure" (this address for WinSCP as well and settings from step A.3. apply).
http://i26.tinypic.com/5pphcw.jpg

2. Connect your N900 via USB and:
http://i32.tinypic.com/ehhvnl.jpg

3. When you want the old USB mode back, re-enable mass storage mode via: "Manage USB" -> "Load g_nokia" -> "close".

I have also updated the Wiki, check it if you don't understand something or simply ask.

:D If this post helped you, please check out the ideas in my signature and cast a vote if you think they're worth it :D

starman 2010-01-20 13:50

Re: Full file system access: OpenSSH + WinSCP
 
Quote:

Originally Posted by Bec (Post 482844)
Get full access over your N900 file system in 3 easy steps!

Watch out what you replace or delete or you might end up with a bricked device!
Always make a backup first!
Never edit files in "sudoers.d"!


1. Enable the maemo.org repository by simply clicking this link (you should have it by default if your device is updated)
(if you don't find the files requested below, the extras-testing repository too, manually by entering the details linked here into the app manager.

2. Install the following apps: Open SSH Client and Open SSH server on your N900.
-be sure to enter a "strong" password that you'll remember for Open SSH!
-you should also install the showIP widget for your desktop

3. Download WinSCP, a very nice free SSH client for windows and configure it as follows:

http://i50.tinypic.com/2m5ik1x.jpg

Host name: your N900 ip, get it from over here or install the showIP widget from app manger.
-please remember that it may change on router/modem resets or because of your ISP
Port number: 22
User name: root
Password: a strong one - same as the one entered in Open SSH
Protocol: SFTP + SCP fallback

:D If this post helped you, please check out the ideas in my signature and cast a vote if you think they're worth it :D

Is there an App/Program that will enable and disable the SSH protocol when needed, my thinking is that having a server running all the time will be a battery drain, plus within the app the IP address could be shown..

You'll probably tell me the xterminal codes but I'd prefer a whole app - it'll just be easier to manage

Plus is there a way to use the apf protocol used by mac computers?? That way the N900 will be auto discovered by OSX and show as a mounted drive, I had a similar program on my jailbroken 3GS which was awesome...

SubCore 2010-01-20 13:55

Re: Full file system access: OpenSSH + WinSCP
 
Quote:

Originally Posted by starman (Post 484212)
Is there an App/Program that will enable and disable the SSH protocol when needed, my thinking is that having a server running all the time will be a battery drain,

that's not the case.
the daemon is not "running" when there are no connections, it's idling - it doesn't consume any cpu cycles.

Bec 2010-01-20 14:11

Re: Full file system access: OpenSSH + WinSCP
 
Quote:

Originally Posted by starman (Post 484212)
plus within the app the IP address could be shown..

What app are you talking about? I was talking about a desktop widget that shows your ip and is very practical to have if you connect to multiple networks all the time (I do) - get if from the repositories..
If you don't need it, just type show ip in google and pick a result.

"APF" is a make-belief protocol only used on mac but there should be other softwares supporting the more common protocols available for mac as well.

Check here for mounting the folders of your N900: http://talk.maemo.org/showpost.php?p...1&postcount=10

WinSCP (and other SCPs too) is not an explicitly used for mounting a folder as it is a rather complex wireless file manager.

Please be so kind and don't quote my whole post, it's a little big don't you think?

stayloa 2010-01-20 14:13

Re: Full file system access: OpenSSH + WinSCP
 
Thanks for the guide.

Couple of questions though:

1) The repos have a client (installed), server (installed) and an extra "client and server" which is now 2kb. Do I need this too?

2) How do I set a password on the N900 for openssh? I'm not prompted to on install...

Thanks!

starman 2010-01-20 14:15

Re: Full file system access: OpenSSH + WinSCP
 
Quote:

Originally Posted by Bec (Post 484250)
What app are you talking about? I was talking about a desktop widget that shows your ip and is very practical to have if you connect to multiple networks all the time (I do) - get if from the repositories..
If you don't need it, just type show ip in google and pick a result.

"APF" is a make-belief protocol only used on mac but there should be other softwares supporting the more common protocols available for mac as well.

Check here for mounting the folders of your N900: http://talk.maemo.org/showpost.php?p...1&postcount=10

WinSCP (and other SCPs too) is not an explicitly used for mounting a folder as it is a rather complex wireless file manager.

Please be so kind and don't quote my whole post, it's a little big don't you think?

Cheers................. :D

NvyUs 2010-01-20 14:16

Re: Full file system access: OpenSSH + WinSCP
 
correct me if i'm wrong but i think you need to install rootsh first.

Bec 2010-01-20 14:19

Re: Full file system access: OpenSSH + WinSCP
 
Quote:

Originally Posted by NvyUs (Post 484259)
correct me if i'm wrong but i think you need to install rootsh first.

I know I had it when I did this but I don't think you really need it.

OpenSSH installs and asks for pw automatically and that's it.

SCP doesn't need root permission.

torpedo48 2010-01-20 14:19

Re: Full file system access: OpenSSH + WinSCP
 
Quote:

Originally Posted by stayloa (Post 484256)
Thanks for the guide.

Couple of questions though:

1) The repos have a client (installed), server (installed) and an extra "client and server" which is now 2kb. Do I need this too?

2) How do I set a password on the N900 for openssh? I'm not prompted to on install...

Thanks!

Quick answers:

1) Yes you do

2) Have a look here this might help:

http://talk.maemo.org/showthread.php?t=37004

SubCore 2010-01-20 14:24

Re: Full file system access: OpenSSH + WinSCP
 
Quote:

Originally Posted by torpedo48 (Post 484268)
1) Yes you do

No, he doesn't.
the package with both is just a metapackage to install the two other packages at once.

torpedo48 2010-01-20 15:05

Re: Full file system access: OpenSSH + WinSCP
 
Quote:

Originally Posted by SubCore (Post 484276)
No, he doesn't.
the package with both is just a metapackage to install the two other packages at once.

I thought that removing that metapackage would remove both client and server, sorry for my nescience.

greygoo 2010-01-20 15:14

Re: Full file system access: OpenSSH + WinSCP
 
I also just added a guide on setting up public key based login as the user on the N900 instead of root which should avoid possible permission issues of files copied to the N900 and make the whole thing more secure:

http://talk.maemo.org/showthread.php...318#post484318

Accessing the fs then as user with sshfs:

http://talk.maemo.org/showthread.php...334#post484334

My guides however focus exclusively on having a linux computer to connect from, so they are just an addition here.

SubCore 2010-01-20 16:05

Re: Full file system access: OpenSSH + WinSCP
 
Quote:

Originally Posted by torpedo48 (Post 484351)
I thought that removing that metapackage would remove both client and server, sorry for my nescience.

yes, removing the metapackage will remove the other two as well, but he asked if he needed to install this additional package also... if i understood him correctly :)

torpedo48 2010-01-20 16:57

Re: Full file system access: OpenSSH + WinSCP
 
Quote:

Originally Posted by SubCore (Post 484459)
yes, removing the metapackage will remove the other two as well, but he asked if he needed to install this additional package also... if i understood him correctly :)

Ah ok I misunderstood him :)

Big Phat Jan 2010-01-20 17:07

Re: Full file system access: OpenSSH + WinSCP
 
Quote:

Originally Posted by Bec (Post 482844)
Get full access over your N900 file system in 3 easy steps!

I have a one step alternative:

Use the terminal! :D

Bec 2010-01-20 19:22

Re: Full file system access: OpenSSH + WinSCP
 
Quote:

Originally Posted by Big Phat Jan (Post 484592)
I have a one step alternative:

Use the terminal! :D

The day the N900 gets delivered with "the big book of linux" - wannabe hacker/dev edition I will.

Till then I'll avoid it in any way I can :D

greygoo 2010-01-20 20:09

Re: Full file system access: OpenSSH + WinSCP
 
The biggest most importand and absolute necessary thing to know about the linux shell to know is: there is TAB completion !!

If you want to see all commands available to the current user that start with e.g. the letter 'l' just type 'l' and then hit the "TAB" button twice. You'll get a list of all avilable commands that start with 'l'. You can always hit tab, even to verify you spell the commands correctly. Additionally, when entering a path in a filesystem, TAB also completes the paths or shows you all available ones.

Just start the X Terminal and type (all but the < and > character)

ls MyD <TAB><TAB><TAB>.doc<TAB><Enter>

If someone really wants to know more about the Linux on the command line, I can recommend these online books:

For a good overview and typical tipps and tricks:
http://dsl.org/cookbook/cookbook_toc.html

As great reference and a really good overview of most linux commands:
http://books.google.de/books?id=sI_X...age&q=&f=false

Especially the chapter "Linux commands" is really useful.
Beside that I can only suggest to try everything on some Linux on a big computer first, before screwing up your N900, a good and quick start would e.g. to boot a ubuntu live CD.

pisthpeeps 2010-01-20 20:54

Re: Full file system access: OpenSSH + WinSCP
 
I tried this in my WLAN and works nicely. Thanks. Few questions,
Should the n900 and the computer should be on the same WLAN/Network for this to work? Or can this be done from anywhere in the world over the internet if we know the ip?
Also if i use the ip using the showip.net it shows me the public ip of n900 and it doesnt work in the winscp when i tried. The ip assigned by my WLAN router is the one which works fine. Can you clarify?

JereHakala 2010-01-20 21:01

Re: Full file system access: OpenSSH + WinSCP
 
I get "Connection refused" from WinSCP, do I need to have Wi-Fi to use this? With iPhone I managed to get full access with WinSCP without Wi-Fi (Just openSSH, USB cable and WinSCP.)

Bec 2010-01-20 21:15

Re: Full file system access: OpenSSH + WinSCP
 
I really don't think you connected iphone via usb with winscp and Openssh alone, when I used to do this it was a little more complicated tha that.

Either way this tutorial requires indeed wi-fi.

But why would you bother that much since N900 connects "just like that" via usb, plug n' play?
If you think it's worth bothering here's some guys who did it: http://talk.maemo.org/showthread.php?t=37720
Or read this: http://sumoudou.org/相撲外:Mount%20the%...%20a%20PC.html

JereHakala 2010-01-20 21:25

Re: Full file system access: OpenSSH + WinSCP
 
Quote:

Originally Posted by Bec (Post 485233)
I really don't think you connected iphone via usb with winscp and Openssh alone, when I used to do this it was a little more complicated tha that.

Either way this tutorial requires indeed wi-fi.

But why would you bother that much since N900 connects "just like that" via usb, plug n' play?
If you think it's worth bothering here's some guys who did it: http://talk.maemo.org/showthread.php?t=37720
Or read this: http://sumoudou.org/相撲外:Mount%20the%...%20a%20PC.html

Hmm okay, I will try that sumoudou.org's thing.
Thanks.

Bec 2010-01-20 21:31

Re: Full file system access: OpenSSH + WinSCP
 
You could ask those guys aswell...

msa 2010-01-21 23:04

Re: Full file system access: OpenSSH + WinSCP
 
does not work for me.
the connection always times out.

oh man, i just want access to /usr/share/icons/hicolor/scalable/hildon without using the console so i can replace some files - it cant be that hard?!

/edit.

FINALLY got it to work. thank god.

niqbal 2010-01-25 07:31

Re: Full file system access: OpenSSH + WinSCP
 
omg why didnt i come across this post earlier. took me quite a few hrs to find a suitable client software.

btw, why would u install openssh-client on n900. client side would be laptop from where u r accessing ur n900.

just install openssh-server, start the server through terminal and use client software to access the server (n900)

Venomrush 2010-01-28 13:57

Re: Full file system access: OpenSSH + WinSCP
 
I'm having some problems on Windows 7.
On XP it works great.

I kept getting Destination host unreachable error, I have already added WinSCP to allow list in firewall.
Any ideas?

N900 local IP is 192.168.1.125.
When ping by using the command "ping 192.168.1.125" in cmd, it said..
"Reply 192.168.1.82: Destination host unreachable"
I don't know why it shows 192.168.1.82 (which is my laptop) instead of 192.168.1.125 (the N900)

Running Windows 7 Ultimate 32-bit, WinSCP latest verion, N900 has OpenSSH Client + Server

leetut 2010-01-31 16:06

Re: Full file system access: OpenSSH + WinSCP
 
i get:
network error: connection refused
only started happening this morning, worked fine for the past month
anyone know why?

torpedo48 2010-01-31 16:13

Re: Full file system access: OpenSSH + WinSCP
 
Does anyone know if it is possible to open an SSh session through USB cable?

Bec 2010-02-01 11:51

Re: Full file system access: OpenSSH + WinSCP
 
Quote:

Originally Posted by Bec (Post 482844)
Host name: your N900 ip, get it from over here or install the showIP widget from app manger.
-please remember that it may change on router/modem resets or because of your ISP

Maybe your IP has changed.

leetut 2010-02-01 12:02

Re: Full file system access: OpenSSH + WinSCP
 
my ip has never changed.

i get:
network error: connection refused
only started happening YESTERDAY, worked fine for the past month
anyone know why?

infact i fixed it yesterday by uninstalling OpenSHH from phone, and WinSCP from pc
and reinstalling them

but i wake up today and its not working again
and reinstalling does not work now

Big Phat Jan 2010-02-01 12:33

Re: Full file system access: OpenSSH + WinSCP
 
Quote:

Originally Posted by leetut (Post 504940)
Quote:

i get:
network error: connection refused
only started happening this morning, worked fine for the past month
anyone know why?

i get:
network error: connection refused
only started happening this morning, worked fine for the past month
anyone know why?

i get:
network error: connection refused
only started happening this morning, worked fine for the past month
anyone know why?
i get:
network error: connection refused
only started happening this morning, worked fine for the past month
anyone know why?

i get:
network error: connection refused
only started happening this morning, worked fine for the past month
anyone know why?

i get:
network error: connection refused
only started happening this morning, worked fine for the past month
anyone know why?

i get:
network error: connection refused
only started happening this morning, worked fine for the past month
anyone know why?

Patience grasshopper. I imagine many people that may have been able to help have been put off by the fact you have posted this approximately 1000 times across numerous threads in less than a day!

There are many variables here. Some suggestions:
  • Have you definitely installed the ssh server on your phone (not just the client)? If you have previously had a successful connection with this install then don't worry about this one.
  • Have you accidentally stopped the ssh daemon? You can test with "ps -A | grep sshd" in a terminal. You should see an sshd process owned by root.
  • Have you accidentally messed with any files in /home/user/.ssh or /root/.ssh (for example to attempt to set up a key based connection)?
  • Have you for some reason changed the permissions on /home/user or /root? Maybe to allow you to view files in /root as user? If these directories are too permissive then you won't be able to connect.
  • Are you typing the password in correctly?
  • Are you trying to ssh in as user instead of root (I think this may be disallowed by default).
  • Are you trying to SSH in to your phone while it's connected to wifi, using the correct IP? If you are on 3G you will not be able to connect.

There are probably more things, these are just off the top of my head. If this doesn't work you could try enabling logging in winscp to get more information. See here.

EDIT: Thought of another one: Make sure you're using scp, not sftp to connect. If memory serves winscp allows both.

Cheers,
Jan

leetut 2010-02-01 13:01

Re: Full file system access: OpenSSH + WinSCP
 
sorry i ran out of stress pills this morning, the answer is no to all of the above, ive installed no new software either on phone or pc, everything worked fine, now it does not for no apparent reason, none of the other people across the internet who this has happened to have had a fix or a solution to the problem
i just find it very strange that the problem was not highlighted enough, now it is

Big Phat Jan 2010-02-01 13:43

Re: Full file system access: OpenSSH + WinSCP
 
Quote:

Originally Posted by leetut (Post 505055)
sorry i ran out of stress pills this morning, the answer is no to all of the above, ive installed no new software either on phone or pc, everything worked fine, now it does not for no apparent reason, none of the other people across the internet who this has happened to have had a fix or a solution to the problem
i just find it very strange that the problem was not highlighted enough, now it is

What output do you get from these commands? (enter in an xterm on the N900):

Code:

ps -A | grep sshd
Code:

/sbin/ifconfig wlan0 | grep inet
Next, you could open up a shell on the computer you are trying to connect from (on windows you could search for "cmd" or type "cmd" into the Run... box) and type:

Code:

ping YOUR_IP_ADDRESS
Where YOUR_IP_ADDRESS is ... your IP address!

Also could you confirm again that the answer to all of the following questions is yes (sorry to repeat myself, just making sure):
  • You have selected scp as the protocol in WinSCP (not sftp).
  • You are connecting as root.
  • You are entering the password correctly (no caps lock, etc).

If everything here looks OK you'll have to enable logging from WinSCP I think and post the output here (link in my last post).

Cheers,
Jan

Wiener 2010-02-01 13:51

Re: Full file system access: OpenSSH + WinSCP
 
Works fine with me :-)

I can recommend the following PC-Side software:

1.) Putty for login into N900. http://www.chiark.greenend.org.uk/~s.../download.html
2.) Filezilla for copying files. http://filezilla-project.org/
3.) I am copying my Pictures from N900 -> Linux server using rsync, and my home data/music from Linux Server -> N900 (also rsync)

Who need iBlah etc ? :-)

Also check in a WLAN, that the router allows connections between devices ...

leetut 2010-02-01 14:49

Quote:

Originally Posted by Big Phat Jan (Post 505088)

Also could you confirm again that the answer to all of the following questions is yes (sorry to repeat myself, just making sure):
  • You have selected scp as the protocol in WinSCP (not sftp).
  • You are connecting as root.
  • You are entering the password correctly (no caps lock, etc).

ive just got it working again by uninstalling and reinstalling WinSCP from pc and OpenSSH from phone until it worked (had to do it approx 30 times over 3 hours)
strange thing is i managed to do that yesterday after reinstalling only once

i have not selected anything other than the default protocol, and for me that is: SFTP, and 'allow FCP fallback' is ticked, i tried changing all of these when it wasnt working and it made no difference,

the app worked for approx 6weeks with these settings, and its now working again with these settings

yes my user name is 'root'
and yes my password is correct

but when its not working those things seem irrelevant anyway cos even if i leave username and passwork blank or if i deliberately type a different password and username i still get the same : network error: connection refused

my wireless router has always been perfect for every device or program associated with it so i cant blame that

would still like to see a solution as the next person with this problem will end up searching the internet all day like i did yesterday, and seeing lots of other people with the problem but with no clear solution for fixing it

as strange as it may sound i think that actually typing my ip addr into WinSCP when creating a new login profile, instead of pasting it in from a text file was what fixed it, (even though there both exactly the same)
ill find out next time it goes off

Au{R}oN 2010-02-01 14:57

Re: Full file system access: OpenSSH + WinSCP
 
My Transfer Speed can barely reach 10kb/s... is that normal??

It's painfull...

Bec 2010-02-01 15:05

Re: Full file system access: OpenSSH + WinSCP
 
@leetut
Told you it was the ip :p

@Au{R}oN
No it's not, are your router's ports forwarded properly?
Is the signal strong enough?
What kind of router do you have? B/G, B/G/M, B etc...?

hellnick 2010-02-01 15:05

Re: Full file system access: OpenSSH + WinSCP
 
Quote:

Originally Posted by leetut (Post 505172)
ive just got it working again by uninstalling and reinstalling WinSCP from pc and OpenSSH from phone until it worked (had to do it approx 30 times over 3 hours)
strange thing is i managed to do that yesterday after reinstalling only once

i have not selected anything other than the default protocol, and for me that is: SFTP, and 'allow FCP fallback' is ticked, i tried changing all of these when it wasnt working and it made no difference,

the app worked for approx 6weeks with these settings, and its now working again with these settings

yes my user name is 'root'
and yes my password is correct

but when its not working those things seem irrelevant anyway cos even if i leave username and passwork blank or if i deliberately type a different password and username i still get the same : network error: connection refused

my wireless router has always been perfect for every device or program associated with it so i cant blame that

would still like to see a solution as the next person with this problem will end up searching the internet all day like i did yesterday, and seeing lots of other people with the problem but with no clear solution for fixing it

If you want to find a solution to the problem you had then you need to be more methodical when troubleshooting the issue. You reinstalled the application both on the device and the PC so you can't really be sure which one was having the problem.

It wouldn't hurt to thank the person who tried to talk you through the problem either.

Au{R}oN 2010-02-01 23:23

Re: Full file system access: OpenSSH + WinSCP
 
Quote:

Originally Posted by Bec (Post 505211)
@Au{R}oN
No it's not, are your router's ports forwarded properly?
Is the signal strong enough?
What kind of router do you have? B/G, B/G/M, B etc...?

Yes port are correctly forwarded
Yes the signal is strong (Max)

My Router is a Belkin and support B/G/N


Also, i have absolutely NO PROBLEM when using N900 Wi-fi for navigation.

leetut 2010-02-02 23:41

Re: Full file system access: OpenSSH + WinSCP
 
again today i have the 'daily' network error: connection refused
cant log in, tried too many times already, cant be the ip cos im typing the correct ip into the box, worked all day yesterday, then today it wont work again

@hellnick: reinstalling the application both on the device and the PC makes no difference now, it still wont work

i do thank people, if ive missed anyone i apologise, i dont want anyone to thank me in public, i much prefer thanks in a pm cos its more personal, but to be honest the 'thanks/rep' function should be removed, every forum ive ever used that had that function always gave me bad feelings, i think its cos i see too many people being downright rude to newcomers on big forums like this (yes i experienced it on this forum when i first joined) it does make people take on a more dismissive personality when asking for help, compared to forums where everyone is nice to eachother, where i have a very helpfull and understanding personality, where i stay up for hours helping people, the problem could be fixed with some very strict moderating, or we could fix it ourselves, anyway enough ranting from me, from now on ill be mr nice guy i promise

would love to know why i cant log in tho!

nintendogs 2010-02-03 00:12

Re: Full file system access: OpenSSH + WinSCP
 
This is the best method ever. I can't believe I'm using ssh to upload and download things from a phone...

It's so great to back up files, download camera pictures and upload whatever I need just by connecting to my wifi ap and clicking a shortcut on the desktop, it's so convenient I almost can't believe it.

I'm using filezilla as a client, works really well.


| 1   2   | Next
All times are GMT. The time now is 12:17.

vBulletin® Version 3.8.8