IgnorantGuru / spacefm

SpaceFM File Manager
http://ignorantguru.github.com/spacefm/
GNU General Public License v3.0
489 stars 73 forks source link

ssh:// problems #175

Closed slackhead closed 12 years ago

slackhead commented 12 years ago

When I try to ssh:// an URL I can put in password correctly but always get Connection reset by peer.

Same thing happens if I 'udevil mount 'ssh://....' or use sshfs in a terminal.

Nothing gets mounted. I'm not sure if this is an issue with sshd on the host.

VastOne commented 12 years ago

I see that message whenever I do not have the rights to the ssh server. I would verify that you do have access by trying to ssh from terminal to the machine first.

slackhead commented 12 years ago

Well I ssh to it all the time but I think it's because I set up a sftp chroot, which is giving problems. As soon as I comment out the chroot part and restart sshd it seems to be working. Although it puts me in / rather than my home.

slackhead commented 12 years ago

It seems to have been a permissions problem - sshd likes owner as root for the chroot. Fixed now.

By the way, offtopic - how do I keep my ssh dir mounted after closing the terminal which asks for password?

VastOne commented 12 years ago

I use keys for mine.

Generate the key first on the cleint...

ssh-keygen

then send it to the ssh server

ssh-copy-id -i $HOME/.ssh/id_rsa.pub user@ip.of.sshh.server

slackhead commented 12 years ago

I do use keys.

VastOne commented 12 years ago

Hmmm I use sshfs and mount it like this in a startup script

sshfs -o allow_other,uid=1000,gid=1000 myuser@my.ssh.server.ip:/media/storage/Music /mnt/remote

slackhead commented 12 years ago

Well I'm just trying to get spacefm to do this. It works anyway so long as I don't try to force a chroot owned by my non-root user. Closing.

IgnorantGuru commented 12 years ago

jfyi, this and similar issues are sshfs issues, because spacefm is a fairly dumb front-end only. When you enter a network URL, it runs udevil or the custom protocol handler. When the command completes, it checks to see if the URL is mounted, and if so, opens the directory. (With ssh, you need to open the directory by clicking on it in the devices list, because ssh is not run as a task - see my comment in #176 on this).

udevil in turn is a simple front-end to mount. You can run udevil directly with the same URL to debug. Running udevil --verbose will show you the mount command it issues, which you can also test directly. mount in turn uses the fuse/sshfs mount helper to mount ssh.

Because udevil is mount front-end, it mounts sshfs as root, and generally only gives the user write access (sets uid=your user by default). This is analogous to mounting sshfs in fstab, except that udevil lets you do so at any time and as a normal user. Thus any sshfs keys may need to be installed to /root, similar to the fstab situation. Or I think you can specify other credentials.

If you want to mount sshfs as a normal user instead, you can simply run sshfs directly rather than udevil. In spacefm this can be accomplished with a custom protocol handler script or a custom command. Eventually spacefm may run sshfs directly rather than udevil, but this hasn't been coded.

So the good news is that if you get sshfs mounting via mount as root, it should work fine in udevil and spacefm. But getting it that point is up to you.

IgnorantGuru commented 12 years ago

By the way, offtopic - how do I keep my ssh dir mounted after closing the terminal which asks for password?

There appears to be a bug in sshfs which causes it to unmount when its terminal is closed. Nothing I tried had any impact on this issue, so spacefm currently advises you to leave the terminal window open. This is also why it won't open the mount point automatically (#176).

If you find any solution to sshfs unmounting when its terminal is closed, I'd like to hear it. Or you may want to post a bug to sshfs. I support sshfs minimally (spacefm is just a front-end).

tkoun commented 11 years ago

If you find any solution to sshfs unmounting when its terminal is closed, I'd like to hear it. Or you may want to post a bug to sshfs. I support sshfs minimally (spacefm is just a front-end).

why not use nohup when launching the command run in the terminal so that the process started does not terminates when the terminal is closed ?

IgnorantGuru commented 11 years ago

why not use nohup

This does not affect the problem - you can try it yourself as a custom command.

tkoun commented 11 years ago

since you are around, I'd like to say a big bravo for this wonderfull file manager. this is the one for me! I'm impatient to test the Plugins

thanx a lot for it.

I've managed (not without some pain) to make it work under slitaz. I had to go around a few quirks