WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [solved] sshfs not working for me  (Read 31082 times)

Offline Lee

  • Hero Member
  • *****
  • Posts: 645
    • My Core wiki user page
[solved] sshfs not working for me
« on: May 30, 2009, 07:28:31 PM »
Can't get sshfs to work.  Less than a week ago I thought, "wouldn't it be great to have sshfs?".  And there it is.  But I can't get it ti work.  Probably just something dumb that I'm missing.  It asks for the password, I provide the password and it disconnects,  Ssh works fine with the same password, of course, as shown below.

I've tried various combinations of full paths for both the remote directory and the mountpoint and have tried the whole mess with sudo as well.  (The mount point is /home/tc/asimov.) The remote computer (its only 5 feet away) is running tc 1.3, the local is running tc 1.2.

Code: [Select]
tc@oklahoma:~$
tc@oklahoma:~$
tc@oklahoma:~$ sshfs tc@192.168.0.27: asimov
tc@192.168.0.27's password:
remote host has disconnected
tc@oklahoma:~$
tc@oklahoma:~$
tc@oklahoma:~$ ssh tc@192.168.0.27

Secure login powered by Dropbear SSH server.
tc@192.168.0.27's password:
 (o-
 //\  Tiny Core Linux 1.3
 v_/_       asimov

tc@asimov:~$ exit
Connection to 192.168.0.27 closed.
tc@oklahoma:~$
tc@oklahoma:~$
« Last Edit: June 01, 2009, 07:38:52 PM by Lee »
32 bit core4.7.7, Xprogs, Xorg-7.6, wbar, jwm  |  - Testing -
PPR, data persistence through filetool.sh          |  32 bit core 8.0 alpha 1
USB Flash drive, one partition, ext2, grub4dos  | Otherwise similar

Offline alu

  • Sr. Member
  • ****
  • Posts: 429
Re: sshfs not working for me
« Reply #1 on: May 30, 2009, 11:26:19 PM »
isn't sshfs used in order to mount drive on a remote machine? if yes, i think it is more somthg like:

sshfs tc@ip-of-the-remote-host:/disk-or-folder-to-mount /place-where-to-mount-it-on-your-machine (typically /home/tc/folder-or-mount-point)

the remote host will then ask for the password, and should let you log in.

(it might be smthg slightly different since i dont use ssh for a while)

Offline Lee

  • Hero Member
  • *****
  • Posts: 645
    • My Core wiki user page
Re: sshfs not working for me
« Reply #2 on: May 31, 2009, 12:33:07 AM »
Quote
isn't sshfs used in order to mount drive on a remote machine? if yes, i think it is more somthg like:

sshfs tc@ip-of-the-remote-host:/disk-or-folder-to-mount /place-where-to-mount-it-on-your-machine (typically /home/tc/folder-or-mount-point)

Yes that's it exactly.  If I understand it correctly, the default directory to mount will be the specified user's home directory (if nothing is given following the colon), and if the mount point is in the current directory there should be no need to specify its full path.  In any case specifying full paths:

Code: [Select]
tc@oklahoma:~$
tc@oklahoma:~$ sshfs tc@192.168.0.27:/home/tc /home/tc/asimov
tc@192.168.0.27's password:
remote host has disconnected
tc@oklahoma:~$

yields the same result.
32 bit core4.7.7, Xprogs, Xorg-7.6, wbar, jwm  |  - Testing -
PPR, data persistence through filetool.sh          |  32 bit core 8.0 alpha 1
USB Flash drive, one partition, ext2, grub4dos  | Otherwise similar

Offline combo3

  • Full Member
  • ***
  • Posts: 148
Re: sshfs not working for me
« Reply #3 on: May 31, 2009, 03:17:56 AM »
Unfortunately, Dropbear doesn't support sftp out of the box.

You have two options:

1) install and run openssh on the host, or

2) download openssh and extract the missing binary:

   - Open appbrowser
   - Select Connect > TCZ > openssh.tcz
   - Click on Download Only
   - Select File > Install Optional > openssl-0.9.8h.tczl
   - Click: Ok
   - Select: File > Install Optional > openssh.tcz (but don't install it)
   - Make note of the path in the textbox next to Filename:
   
   - Open Aterm

Code: [Select]
$ mkdir openssh
$ sudo mount -o loop /path/to/tce/optional/openssh.tcz openssh
$ sudo mkdir /usr/libexec
$ sudo cp openssh/usr/local/libexec/sftp-server /usr/libexec
$ sudo umount openssh
$ rmdir openssh
   
   - Open control panel and start SSH server

To make it permanent, add /usr/libexec/sftp-server to /opt/.filetool.lst
and keep openssl-0.9.8h.tczl in your tce directory.

Offline Lee

  • Hero Member
  • *****
  • Posts: 645
    • My Core wiki user page
Re: sshfs not working for me
« Reply #4 on: May 31, 2009, 12:03:34 PM »
Quote
Unfortunately, Dropbear doesn't support sftp out of the box.

You have two options:

1) install and run openssh on the host, or

2) download openssh and extract the missing binary:

Thanks for the detailed info.  I'll try that this evening.

I had thought that I was all set since scp works, but sshfs running over sftp explains the problem.

32 bit core4.7.7, Xprogs, Xorg-7.6, wbar, jwm  |  - Testing -
PPR, data persistence through filetool.sh          |  32 bit core 8.0 alpha 1
USB Flash drive, one partition, ext2, grub4dos  | Otherwise similar

Offline Lee

  • Hero Member
  • *****
  • Posts: 645
    • My Core wiki user page
Re: sshfs not working for me
« Reply #5 on: June 01, 2009, 07:38:14 PM »
Thank you combo3.   That worked very nicely.

I ended up turning off dropbear (at the control panel "SSH Server" button) and installing the full extension of openssh.tcz.  Then I started sshd from the command line.

I eventually cleared out ~/.sshd/known_hosts completely on both boxes before I got sshfs to work.  I don't know if it was necessary to do that on both, but whichever one I did first didn't do the trick.
32 bit core4.7.7, Xprogs, Xorg-7.6, wbar, jwm  |  - Testing -
PPR, data persistence through filetool.sh          |  32 bit core 8.0 alpha 1
USB Flash drive, one partition, ext2, grub4dos  | Otherwise similar

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14817
Re: [solved] sshfs not working for me
« Reply #6 on: September 05, 2009, 06:35:33 AM »
I played around with this a while, but couldn't make it work.

I guess the trick is in "Then I started sshd from the command line" - I presume various keys need to be generated (in a similar fashion to /etc/init.d/dropbear), but which keys and where?

..and which extensions are required on the server and which extensions are required on the client.

I tried the short cut, by copying /usr/local/libexec/sftp-server from the openssh extension, but this didn't want to work with the base tc ssh server either.


Offline combo3

  • Full Member
  • ***
  • Posts: 148
Re: [solved] sshfs not working for me
« Reply #7 on: September 06, 2009, 04:51:24 AM »
Actually, the copy/paste process is no longer necessary.

Server Setup

1) Download and install the extension sftp-server submitted by Daniel Barnes

ftp://distro.ibiblio.org/pub/linux/distributions/tinycorelinux/tcz/
ftp://distro.ibiblio.org/pub/linux/distributions/tinycorelinux/tce/

(Note: although these files are located in the TC 1.x respository they work just as well with TC 2.2)

2) Create a password for user tc:

Code: [Select]
sudo passwd tc
3) Start Dropbear via  Contol Panel > SSH Server

Done!


Client Setup

Install extension sshfs-fuse-2.2 with appbrowser

Done!

Now Try It Out!

On the SSH server:

1) Open a terminal and create a test directory in /home/tc

Code: [Select]
mkdir beatles
2) Switch to your directory and create some empty files

Code: [Select]
cd beatles
touch john paul george ringo

3) Get your ip address

Code: [Select]
ifconfig eth0 | grep inet

On the client

4) Open a terminal and create a mountpoint in /home/tc

Code: [Select]
mkdir ssh-host
5) Invoke the sshfs command

Code: [Select]
sshfs -d tc@ip_addresss_from_step_3:/home/tc/beatles ssh-host
6) You should see something similar to this:

Host 'x.x.x.x' is not in the trusted hosts file.
(fingerprint md5 fb:e0:52:98:fe:ab:ef:f9:f0:4a:78:8e:2f:5c:36:c0)
Do you want to continue connecting? (y/n)

(Note: if you leave out the -d switch, the cursor will hang and wait for confirmation without displaying the message.)

7) Press y and hit enter

8) Supply your password

9) Issue a list command on the mounted directory

Code: [Select]
ls ssh-host
You should see the files created in step 2.

To Unmount

From the /home/tc directory on the client enter:

Code: [Select]
fusermount -u ssh-host
{Edit: Added unmount instructions}
« Last Edit: September 06, 2009, 12:13:42 PM by combo3 »

Offline combo3

  • Full Member
  • ***
  • Posts: 148
Re: [solved] sshfs not working for me
« Reply #8 on: September 06, 2009, 05:07:45 AM »
On a side note, I just noticed an error in my submission.

The openssh and openssl-0.9.8h dependencies are not required by sshfs-fuse-2.2 on the client.
 
Could whoever administers the extensions please remove them from the dependency list and info file.

Thanks.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: [solved] sshfs not working for me
« Reply #9 on: September 06, 2009, 08:37:25 AM »
On a side note, I just noticed an error in my submission.

The openssh and openssl-0.9.8h dependencies are not required by sshfs-fuse-2.2 on the client.
 
Could whoever administers the extensions please remove them from the dependency list and info file.

Thanks.
Done.
The only barriers that can stop you are the ones you create yourself.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: [solved] sshfs not working for me
« Reply #10 on: September 18, 2010, 05:05:20 PM »
On a side note, I just noticed an error in my submission.

The openssh and openssl-0.9.8h dependencies are not required by sshfs-fuse-2.2 on the client.
 
Could whoever administers the extensions please remove them from the dependency list and info file.

Thanks.
Done.

At current those deps are present, as well in 2.x as in 3.x repos.
And I recall having given up on sshfs-fuse a few months ago already, exactly to avoid those deps, when I preferably use dropbear over openssh.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline danielibarnes

  • Hero Member
  • *****
  • Posts: 548
Re: [solved] sshfs not working for me
« Reply #11 on: September 20, 2010, 08:40:31 PM »
Actually, the copy/paste process is no longer necessary.

Server Setup

1) Download and install the extension sftp-server submitted by Daniel Barnes

ftp://distro.ibiblio.org/pub/linux/distributions/tinycorelinux/tcz/
ftp://distro.ibiblio.org/pub/linux/distributions/tinycorelinux/tce/

(Note: although these files are located in the TC 1.x respository they work just as well with TC 2.2)

I should probably update that ... :)

Offline combo3

  • Full Member
  • ***
  • Posts: 148
Re: [solved] sshfs not working for me
« Reply #12 on: September 20, 2010, 11:33:37 PM »
On a side note, I just noticed an error in my submission.

The openssh and openssl-0.9.8h dependencies are not required by sshfs-fuse-2.2 on the client.
 
Could whoever administers the extensions please remove them from the dependency list and info file.

Thanks.
Done.

At current those deps are present, as well in 2.x as in 3.x repos.
And I recall having given up on sshfs-fuse a few months ago already, exactly to avoid those deps, when I preferably use dropbear over openssh.

The openssh deps were removed, but I reinstated them in an updated submission after further testing revealed that while dropbear and sshfs-fuse worked well on the same network, connections to outside hosts would hang and timeout.

I've just tested them together again... without success. If you plan on using dropbear/sshfs-fuse only on a local network, then a possible workaround would be to manually remove openssh from the sshfs-fuse dep file.

However, I'm open to other suggestions.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: [solved] sshfs not working for me
« Reply #13 on: September 21, 2010, 01:47:03 AM »
Ah, makes sense then, thanks
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: [solved] sshfs not working for me
« Reply #14 on: March 02, 2011, 12:17:22 AM »
Actually, the copy/paste process is no longer necessary.

Server Setup

1) Download and install the extension sftp-server submitted by Daniel Barnes

ftp://distro.ibiblio.org/pub/linux/distributions/tinycorelinux/tcz/
ftp://distro.ibiblio.org/pub/linux/distributions/tinycorelinux/tce/

(Note: although these files are located in the TC 1.x respository they work just as well with TC 2.2)

I should probably update that ... :)

Sounds like a plan   :P

Code: [Select]
tc@box:~$ tce-load -i /tmp/tce/optional/sftp-server.tcz
mount: mounting /dev/loop4 on /tmp/tcloop/sftp-server failed: Invalid argument
/tmp/tce/optional/sftp-server.tcz: OK

Took me a while to find out that this extension is in a format other than squashfs...   :-\
« Last Edit: March 02, 2011, 02:59:24 AM by tinypoodle »
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)