maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   Fuse and sshfs? (https://talk.maemo.org/showthread.php?t=36654)

AliB 2009-12-10 22:37

Fuse and sshfs?
 
So I got my N900 today, and naturally the first thing I did was install the ssh-client. It's awesome, I love having a fully featured ssh-client, including X-forwarding, in my pocket.

The only thing missing in the ssh-department for me is sshfs. I tend to use it alot and it would be really sweet to have.

Naturally, I googled and forum searched, and found someone claiming there was already a functioning port of fuse and sshfs for the N900. I even found a fuse+sshfs port that might possibly work (mfuse), but it hasn't seen any code submissions since january... And I haven't found anyone linking to it (or any other fuse port for that matter) in an N900/fremantle context. Basically I'm rather hesitant about trying it, as I don't want to cause any potential harm to my precious new toy :)

So, does anyone know if it works? Or is there another port floating around the net that I simply haven't found?

dnastase 2009-12-10 23:51

Re: Fuse and sshfs?
 
There is sshfs and it works. I use it.
In one of the maemo repositories there is the sshfs package.
If it's in the maemo-devel then be aware of the risks (not very well tested software, basically you're the tester).

qole 2009-12-10 23:56

Re: Fuse and sshfs?
 
Yes, sshfs is in the repos, I use it too. Probably in the extras-devel repo.

AliB 2009-12-11 01:15

Re: Fuse and sshfs?
 
That explains why I couldn't find it, hadn't activated extras-devel apparently.

Anyway, thanks for the help!

Eric G 2009-12-15 13:54

Re: Fuse and sshfs?
 
So I checked the Maemo Extras-devel catalog and didn't see SSHFS as a standalone application. I enabled extras-devel, and I did find a bunch Dropbear utilities and gftp that say they support sshfs, but I really just want the same functionality I have on my desktop, just "sshfs user@server /share /mountpoint." Which one do you use?

Keep in mind, I want to mount volumes on my N900, not the other way around.

白い熊 2009-12-15 14:46

Re: Fuse and sshfs?
 
http://sumoudou.org/0/12.html

qole 2009-12-15 18:44

Re: Fuse and sshfs?
 
As White Bear points out on his website, you have to do it from the (root) command line:

Code:

apt-get install sshfs
Note that there's no gui for this, so you'll have to do everything on the command line...

e.g. from root:

Code:

modprobe fuse
mkdir -p /home/user/MyDocs/lanvideo
sshfs bob@192.168.0.5:/media/videos /home/user/MyDocs/lanvideo -o allow_other


Eric G 2009-12-16 04:06

Re: Fuse and sshfs?
 
That worked great! Thanks again!

debernardis 2009-12-16 06:11

Re: Fuse and sshfs?
 
There seem to be some problems though. I cannot "fusermount -u mount_path" because it complains "mount: can't find mount_path in /etc/fstab".

Kenchy 2009-12-20 12:02

Re: Fuse and sshfs?
 
There seems to be a bug (maybe intentional) in the fuse package.

In debian proper any user can mount a fuse filesystem (that is the point of fuse after all) if they are a member of the group "fuse".

There is a udev rule (/etc/udev/rules.d/91-permissions.rules) that tries to set the group ownership of /dev/fuse to "fuse", but fails (presumably) because the group doesn't exist.

To be able to mount sshfs as a user you can either (all must be done as root)

a) chown root:users /dev/fuse (which doesn't persist after a reboot)

b) edit the line in 91-permissions.rules so that it references the "users" group rather than "fuse" (wot I done).

c) add the fuse group and add "user" to it.

The best solution is probably d) add the "fuse" group when the fuse package is installed.

I'll try and find out how I report that bug as I'm a bit new to the N900/maemo.

debernardis 2009-12-20 18:17

Re: Fuse and sshfs?
 
@Kenchy: are you able to "fusermount -u" the mounted directory?

qole 2009-12-20 21:34

Re: Fuse and sshfs?
 
The simplest workaround for maemo would be to add something to /etc/sudoers.d that would let you just do "sudo sshfs..."

Kenchy 2009-12-21 20:06

Re: Fuse and sshfs?
 
@debernardis, I think so, I can't check at the moment, as I have had to hand the n900 to my wife until christmas!

@qole I'm pretty sure running it with sudo won't make any difference. Fuse is intended to be run as by the user that needs the file-system. I have had issues with sshfs run as root (admittedly not on a maemo device).

qole 2009-12-21 22:09

Re: Fuse and sshfs?
 
Quote:

Originally Posted by Kenchy (Post 436725)
@debernardis, I think so, I can't check at the moment, as I have had to hand the n900 to my wife until christmas!

That sounds like an interesting story...

Quote:

Originally Posted by Kenchy (Post 436725)
@qole I'm pretty sure running it with sudo won't make any difference. Fuse is intended to be run as by the user that needs the file-system. I have had issues with sshfs run as root (admittedly not on a maemo device).

Yes, you have to use "-o allow_other" when running as root. But it works; that's how I do it (see my post above).

AliB 2009-12-22 01:49

Re: Fuse and sshfs?
 
Quote:

Originally Posted by debernardis
There seem to be some problems though. I cannot "fusermount -u mount_path" because it complains "mount: can't find mount_path in /etc/fstab".

This happens for me as well. I thought about filing a bug report, but I honestly can't find how to do so for the sshfs package... The bugzilla site does not list any of the extras-testing or extras-devel packages. Not creating the fuse group upon install is also a bug IMO, fuse allowing user mounts is the expected behaviour after all.

Also, has anyone gotten the reconnect option to work? Basically, the ssh-session keeps timing out when the device goes to sleep or switches network, screwing up the mounted sshfs. This is exactly what I thought the '-o reconnect' option was for, but it does not seem to work as expected - the ssh-session still dies after some time of inactivity, or when switching network, without ever reconnecting.

hallgreng 2009-12-23 20:54

Re: Fuse and sshfs?
 
i added the 'fuse' group and 'user' to it after changing the perms on /dev/fuse, it works fine for me now.

-o reconnect works fine for me. i accidentally tested it when i drove home from work (wifi connection). the server was still accessible when i reconnected at home.

AliB 2009-12-24 13:51

Re: Fuse and sshfs?
 
Did you get fusermount -u to work as well? While I can
Code:

sudo gainroot
umount path/

it would be nice to be able to unmount without root.

I see no practical difference at all in behaviour with or without -o reconnect... In both cases the mount point becomes inaccessible upon any network disconnect. They do give different errors on access, though. Without reconnect I get "transport endpoint not connected", with it I get "Input/output error" (both returned by, for instance, an ls in the parent directory).

Do you use any additional ssh-options on the server or client? Ie, I've tried a few values of ServerAliveInterval and similar on the client (to no effect).

adalal 2010-01-19 01:44

Re: Fuse and sshfs?
 
bump.. any idea on how to get the fusermount -u to work? using sudo gainroot and umount is quite a lengthy process...

qole 2010-01-19 05:04

Re: Fuse and sshfs?
 
Look into how to use visudo to give yourself sudo powers.

That way, you can just do 'sudo umount /media/myshare'

SubCore 2010-01-19 15:13

Re: Fuse and sshfs?
 
@adalal
another possibility would be to create a dedicated shortcut for unmounting, and use this as value for "Exec=":

/bin/busybox sh -c 'echo umount /media/mountpoint | sudo gainroot'

nymajoak 2010-01-31 16:16

Re: Fuse and sshfs?
 
I've mucked about with sshfs a bit and got it to work. But..

My remote directory has a number of subdirectories and in some cases sub-subdirectories. Accessing this directory structure works fine using the terminal, MicroB, emelfm2, mc and when ssh:ing into the device.

The problem is with the native file browser. It refuses to show any content in subdirectories. They all appear empty. The same thing happens in Petrovich. It doesn't matter if I mount as user or as root (with -o allow_other).

Actually the topmost (alphanumerically speaking) subdirectory is not empty but instead contains seemingly random files/directories from one of the other subdirectories..

I've googled the issue but not come up with anything useful. Is the file browser working correctly for you guys or is it it bug filing time? :)

hallgreng 2010-02-04 06:56

Re: Fuse and sshfs?
 
umounting as a non-root user...

let a user invoke umount with sudo:
Code:

#echo 'user ALL = NOPASSWD: /bin/umount' >> /etc/sudoers
then you can umount with
Code:

$sudo umount /mounted/directory/
i dont like messing around with sudo (i dont use it on my desktop for anything), but it works ^_^
also, mind that this seems to have been undone after the PR1.1 update, so you may have to redo this from time to time.

doesnt hurt to also do it for 'ping'. i use ping and umount in an sshfs mounting script that determines if im on my local lan or if i need to mount over the internet.
Code:

#echo 'user ALL = NOPASSWD: /bin/ping' >> /etc/sudoers

EDIT:
my file browser browses through my ssh mount just fine (albeit a little slowly). i dont know what could be causing your issues digging into the sub directories nymajoak...

my mount command is:
Code:

sshfs -o reconnect,allow_other,uid=1000 -p 22 hallgreng@hallgren-fs.hallgren.net:/ /home/user/MyDocs/hallgren-fs
mount reports as follows:
Code:

hallgreng@hallgren-fs.hallgren.net:/ on /home/user/MyDocs/hallgren-fs type fuse.sshfs (rw,nosuid,nodev,max_read=65536,allow_other,user=user

nymajoak 2010-02-04 11:34

Re: Fuse and sshfs?
 
Quote:

Originally Posted by hallgreng (Post 509948)
my file browser browses through my ssh mount just fine (albeit a little slowly). i dont know what could be causing your issues digging into the sub directories nymajoak...

my mount command is:
Code:

sshfs -o reconnect,allow_other,uid=1000 -p 22 hallgreng@hallgren-fs.hallgren.net:/ /home/user/MyDocs/hallgren-fs
mount reports as follows:
Code:

hallgreng@hallgren-fs.hallgren.net:/ on /home/user/MyDocs/hallgren-fs type fuse.sshfs (rw,nosuid,nodev,max_read=65536,allow_other,user=user

Thanks for that, good to know it "should" work. :)

I didn't use the reconnect, allow_other and uid options so I tried adding them one after the other. My mtab reports the same as your mount now. Unfortunatelly the subdirectory behavior didn't change.

Maybe I should try reinstalling the file manager. Hmm.. Wonder how I do that..

hallgreng 2010-02-04 16:54

Re: Fuse and sshfs?
 
i was going to call myself a liar and say that it DID work but no longer does, however it still does work -but at a completely unusable speed.
45sec to get the contents of /home/ which has ONE directory in it!
it used to be pretty zippy, but no longer. i blame the PR1.1 update.
at least it works well on the command line.

lfcobra 2010-03-21 02:13

Re: Fuse and sshfs?
 
Was wondering if anyone here might be able to help me.

I have sshfs all setup on my n900, and I've made a shell script that will either mount (if not already mounted) or unmount (if it is mounted) the ssh file system. When i run the script from the terminal it works perfectly fine. The file system is mounted and i'm able to access all my content and and when i run the script again it unmounts and I no longer have access. Works exactly like I expect it to.

My problem is that I have followed this how to
http://www.themaemo.com/howto-launch...om-a-shortcut/
to make a shortcut that will run my script. When I click the icon it launches the terminal and i have to type the password for the remote computer as expected. But for some reason the file system is not mounted.

I've tried playing around with the Exec line thinking that was the issue. I've tried the following (my script is located in /usr/bin)
Exec=/usr/bin/osso-xterm ssh_script.sh
Exec=/usr/bin/sh ssh_script.sh
Exec=/usr/bin/ssh_script.sh
Exec=rootsh /usr/bin/osso-xterm ssh_script.sh
None of which resolved the matter of the file system not being mounted. Any ideas?

One more question: After a file system has been successfully mounted I am unable to follow symbolic links. I was curious if this is the correct behavior of sshfs or not.

SubCore 2010-03-23 10:03

Re: Fuse and sshfs?
 
Quote:

Originally Posted by lfcobra (Post 575390)
Exec=rootsh /usr/bin/osso-xterm ssh_script.sh
None of which resolved the matter of the file system not being mounted. Any ideas?

try
Code:

Exec=/bin/busybox sh -c /usr/bin/ssh_script.sh
or, if you need root privileges, maybe this:
Code:

Exec=/bin/busybox sh -c 'echo /usr/bin/ssh_script.sh | sudo gainroot'
as for symlinks - i haven't noticed anything, but i'm not sure if the shares i mount actually contain any.

horli 2010-05-31 18:57

Re: Fuse and sshfs?
 
For the symlink problem add follow_symlinks option to sshfs

LippiVan 2010-08-03 13:21

Re: Fuse and sshfs?
 
Quote:

Originally Posted by qole (Post 429342)
As White Bear points out on his website, you have to do it from the (root) command line:

Code:

apt-get install sshfs

I've tried installing sshfs this way, but I'm always getting an error:

" Temporary failure resolving 'repository.maemo.org' "

Does this have anything to do with PR.1.2?
I'd really like to be able to mount my shares this way, so any help is very appreciated!
thx!

Edit: I've installed all packages manually, seems to be working great!
I'm just amazed of the capabilities of the N900 over and over again, it's never getting boring :)

toxaris 2011-02-03 13:28

Re: Fuse and sshfs?
 
A question.
Can I use sshfs thru a firewall?
I can SSH to the shell on my NAS thru my firewall.
But then I do:
sshfs root@<my public IP>: /path/to/my/files /media/nfs
I get thi error: "Read: Connection reset by peer"

Doing something wrong?
I can mount when Im on the same network.

www.rzr.online.fr 2012-04-18 21:24

Re: Fuse and sshfs?
 
note that sshfs is also working on harmattan :



http://rzr.online.fr/q/fuse# InstalL #SshFs on your MeeGo #HarmattaN HandSet to #MounT RemotE #FileSystem, enlarge your RootFs !n950club !n9

tcbl50 2015-05-04 08:14

Re: Fuse and sshfs?
 
thanks for this. works so wonderful on my N900. ive had this phone for five and a half years and never knew about this!!


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

vBulletin® Version 3.8.8