Tiny Core Linux

Tiny Core Extensions => TCE Talk => Topic started by: Lee on May 30, 2009, 07:28:31 PM

Title: [solved] sshfs not working for me
Post by: Lee 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:~$
Title: Re: sshfs not working for me
Post by: alu 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)
Title: Re: sshfs not working for me
Post by: Lee 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.
Title: Re: sshfs not working for me
Post by: combo3 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.
Title: Re: sshfs not working for me
Post by: Lee 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.

Title: Re: sshfs not working for me
Post by: Lee 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.
Title: Re: [solved] sshfs not working for me
Post by: Juanito 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.

Title: Re: [solved] sshfs not working for me
Post by: combo3 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}
Title: Re: [solved] sshfs not working for me
Post by: combo3 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.
Title: Re: [solved] sshfs not working for me
Post by: curaga 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.
Title: Re: [solved] sshfs not working for me
Post by: tinypoodle 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.
Title: Re: [solved] sshfs not working for me
Post by: danielibarnes 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 ... :)
Title: Re: [solved] sshfs not working for me
Post by: combo3 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.
Title: Re: [solved] sshfs not working for me
Post by: tinypoodle on September 21, 2010, 01:47:03 AM
Ah, makes sense then, thanks
Title: Re: [solved] sshfs not working for me
Post by: tinypoodle 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...   :-\
Title: Re: [solved] sshfs not working for me
Post by: tinypoodle on March 02, 2011, 12:57:46 AM
Mounting the extension, extracting content and then squashing it does work - at least on 2.10
Title: Re: [solved] sshfs not working for me
Post by: tinypoodle on March 02, 2011, 02:47:07 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.

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.

Works like a charm for me for access over internet with dropbear, no openssh whatsoever.
(For reasons of accuracy, this on TC 2.10 and openssl has been installed already for other purposes.)

Also works fine with dropbear/sshfs client side, and dropbear/sftp server side on LAN.

My suggestion would be to consider to remove openssh from dep file and perhaps a line in .info that if for a user it would not work with one of the other ssh clients, then to try openssh.
Title: Re: [solved] sshfs not working for me
Post by: combo3 on March 03, 2011, 10:29:52 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...   :-\

Ah <<light slowly comes on>> so that's why it stopped working.

I'll check it out later today and see if I can get sshfs-fuse working with dropbear and a repackaged sftp-server.

Thanks for your feedback.
Title: Re: [solved] sshfs not working for me
Post by: danielibarnes on March 03, 2011, 11:56:26 AM
I'll update the sftp-server extension today and get it submitted.
Title: Re: [solved] sshfs not working for me
Post by: curaga on March 03, 2011, 01:46:13 PM
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

Just to confirm, this was on 2.x? This should not happen in later versions (showing OK when mount fails).
Title: Re: [solved] sshfs not working for me
Post by: tinypoodle on March 03, 2011, 02:05:45 PM
Yes, that was under 2.10

But a 'file sftp-server.tcz' would explain everything, different filesystem used in prior version (have deleted that after converting it to squashfs).
Title: Re: [solved] sshfs not working for me
Post by: tinypoodle on March 03, 2011, 02:10:15 PM
I'll update the sftp-server extension today and get it submitted.

Thanks, appreciated   :)
Title: Re: [solved] sshfs not working for me
Post by: combo3 on March 06, 2011, 11:38:27 PM
Well, I spent several hours this weekend trying to get sshfs-fuse to work with dropbear and sftp-server without success.

Maybe it's a problem on the host side (A backup server at work running DSL v3.4.11 with OpenSSH_3.6.1p2 Debian 1:3.6.1p2-9, SSH protocols 1.5/2.0, OpenSSL 0x0090702f)

Incidentally, I noticed there are two extensions in the repository (sshfs-fuse-2.2, and sshfs-fuse), so I tried them both.

Since the latter occupies a smaller footprint, I suppose mine can be removed.