PINE64
can't get file transfer working. Help, please! - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PinePhone (https://forum.pine64.org/forumdisplay.php?fid=120)
+--- Forum: PinePhone Software (https://forum.pine64.org/forumdisplay.php?fid=121)
+---- Forum: Mobian on PinePhone (https://forum.pine64.org/forumdisplay.php?fid=139)
+---- Thread: can't get file transfer working. Help, please! (/showthread.php?tid=13910)

Pages: 1 2 3


RE: can't get file transfer working. Help, please! - Zebulon Walton - 05-16-2021

I'm not at all familiar with easyssh. Normally for sshd (that is, ssh server) the config file is /etc/ssh/sshd_config. To enable password authentication you would enable the following line and restart sshd or send it the NOHUP signal to re-read its config:

Code:
PasswordAuthentication yes

If needed you can specify an alternate configuration for the ssh client on the desktop using the "-F configfile" option. From the ssh man page:

Code:
     -F configfile
             Specifies an alternative per-user configuration file.  If a con‐
             figuration file is given on the command line, the system-wide
             configuration file (/etc/ssh/ssh_config) will be ignored.  The
             default for the per-user configuration file is ~/.ssh/config.

Which direction are you trying to make the connection, desktop-->pinephone or pinephone-->desktop?


RE: can't get file transfer working. Help, please! - Koikilensoi - 05-18-2021

So... I was working great... until I decided to have fun installing the latest postmarketOS version...

Now I can mount the directory, but I cannot copy file or even unmount :

fusermount -u /tmp/mnt returns
fusermount: entry for /tmp/mnt not found in /etc/mtab

Trying to unmount on the PC says : Operation not permitted

Note that :
sshfs pinephone@ip:/home/user /tmp/mnt returns
read: Connection reset by peer

sudo sshfs pinephone@ip:/home/user /tmp/mnt makes mnt in /temp an unknown type file

sudo sshfs -o allow_other pinephone@ip:/home/user /tmp/mnt do the job and I can explore the phone's content, but not copy to nor unmount...

I guess i'm missing something about permissions here...


RE: can't get file transfer working. Help, please! - Zebulon Walton - 05-18-2021

Koikilensoi Wrote:So... I was working great... until I decided to have fun installing the latest postmarketOS version...

Now I can mount the directory, but I cannot copy file or even unmount :

fusermount -u /tmp/mnt returns
fusermount: entry for /tmp/mnt not found in /etc/mtab

Trying to unmount on the PC says : Operation not permitted

Note that :
sshfs pinephone@ip:/home/user /tmp/mnt returns
read: Connection reset by peer

sudo sshfs pinephone@ip:/home/user /tmp/mnt makes mnt in /temp an unknown type file

sudo sshfs -o allow_other pinephone@ip:/home/user /tmp/mnt do the job and I can explore the phone's content, but not copy to nor unmount...

I guess i'm missing something about permissions here...

I have not tried postmarketOS so am not familiar with any issues that may have. I think the first thing to do is to back up a bit and make sure you can ssh into your Pinephone. If ssh doesn't work then there's an issue with that which must be resolved before sshfs will work. Once you have ssh working properly you can work with sshfs.

On the PC/laptop side you should not be usining sudo to run sshfs, it is not needed if you have read/write access to the mount point. You would have the proper permissions if you "mkdir /tmp/mnt" from a non-root command shell, or create it using a file manager running in your account. Make sure the account you're logging into on the Pinephone side has permission to access what you need on the phone.


RE: can't get file transfer working. Help, please! - awaittrot - 05-18-2021

If I recall correctly, postmarketOS creates an additional user if you choose to enable SSH at install time. That user does not have write permission to /home/user (default user's home directory).
If you want to mount /home/user on your PC, you have to login as "user".
Code:
sshfs user@ip:/home/user /tmp/mnt

Regarding the security, disabling password authentication is enough for most cases.

Run this on your PC:
Code:
ssh-keygen && ssh-copy-id user@ip
Then edit /etc/ssh/sshd_config on your phone and restart ssh.service

https://wiki.mobian-project.org/doku.php?id=howto:security#using-ssh-with-a-key-instead-of-password


RE: can't get file transfer working. Help, please! - Koikilensoi - 05-18-2021

(05-18-2021, 07:55 AM)Zebulon Walton Wrote: If ssh doesn't work then there's an issue with that which must be resolved before sshfs will work. Once you have ssh working properly you can work with sshfs.

On the PC/laptop side you should not be usining sudo to run sshfs, it is not needed if you have read/write access to the mount point. You would have the proper permissions if you "mkdir /tmp/mnt" from a non-root command shell, or create it using a file manager running in your account. Make sure the account you're logging  into on the Pinephone side has permission to access what you need on the phone.

Thanks again, that was useful.

So... Trying to ssh, I realized that I had a wrong key in /.ssh/known_hosts, probably because it was from the phone's previous OS.
I've deleted it and by ssh again, the new one was added to list of known hosts. And ssh worked fine.

Then I managed to sshfs (without sudo) and it worked fine. I see the phone folder mounted and I can unmount it.

BUT I stil cannot copy files to the phone (still says permission denied).

To be continued...

(05-18-2021, 09:32 AM)awaittrot Wrote: If I recall correctly, postmarketOS creates an additional user if you choose to enable SSH at install time. 

Indeed, that's what I've done.


(05-18-2021, 09:32 AM)awaittrot Wrote: That user does not have write permission to /home/user (default user's home directory).

If you want to mount /home/user on your PC, you have to login as "user".

That would make sense then.

I tried
Code:
sshfs user@ip:/home/user /tmp/mnt
but got Connection reset by peer

Then trying to simply ssh to user@ip, I get Permission denied (publickey,keyboard-interactive).

Don't know if your last bit of code would solved that, haven't tried yet


RE: can't get file transfer working. Help, please! - awaittrot - 05-18-2021

(05-18-2021, 10:00 AM)Koikilensoi Wrote: I tried
Code:
sshfs user@ip:/home/user /tmp/mnt
but got Connection reset by peer

Then trying to simply ssh to user@ip, I get Permission denied (publickey,keyboard-interactive).

Don't know if your last bit of code would solved that, haven't tried yet

It looks like password authentication for default user is disabled in pmOS, so this has to be enabled first. Instructions can be found at pmOS wiki.
https://wiki.postmarketos.org/wiki/SSH#First_login


RE: can't get file transfer working. Help, please! - Koikilensoi - 05-18-2021

(05-18-2021, 11:40 AM)awaittrot Wrote: It looks like password authentication for default user is disabled in pmOS, so this has to be enabled first. Instructions can be found at pmOS wiki.
https://wiki.postmarketos.org/wiki/SSH#First_login

Yep, that was it! Thx!

So now I "just" need to set up a Key-Based Authentication and a proper firewall...


RE: can't get file transfer working. Help, please! - quixote - 05-18-2021

Thanks to all of you helping! It ought to be working based on what you're saying here and what I see elsewhere on the web. (I'm looking *everywhere*). I edited my user ssh_config, system-wide ssh-config and sshd_config in /etc/ssh/. Set "PasswordAuthentication yes" everywhere.

The error messages change a bit, but the message is always the same. Authentication failure or host unknown. My ssh is borked. Is there really no. other. way. to transfer files? 

If I ping the local IP of the pinephone, 10.66.0.82, it's right there. So the hardware is seeing it. There's just nothing that will let me connect.

One thing that occurred to me is that I'm still using stock mobian on the pinephone, so it's just got the 1234 password. Does ssh maybe block stupidly simple passwords??

I was briefly trying pinephone -> desktop. Since that didn't work, I'm back to desktop -> pinephone.

The thing that makes me crazy is I really don't want to troubleshoot ssh. I just need to transfer files. Single user environment. Zero security issues. This is reminding me of the Good Old Days when it was faster and easier to carry a floppy between buildings and transfer files using sneakernet than the miserable protocols available on ethernet. I'm going to take the sd card out and just put the files on it. But, man, I do hate to admit defeat like that.

All suggestions, if anyone has some, gratefully accepted!


RE: can't get file transfer working. Help, please! - Zebulon Walton - 05-18-2021

My next choice if sshfs won't work would be probably be to set up ftp. Other options would include installing Samba for Windows networking, or if you're connecting from a Unix/Linux system you could use NFS. With anything that exposes your files to the network you would want to protect it with a firewall or run it only when needed.

I actually consider sshfs to be the simplest because if you have ssh working sshfs will work as well, nothing more to set up, and I always have ssh going on the Linux systems I work with. (The numerical password works fine with ssh by the way, used it that way on the Pinephone before setting up key-based login.)

Actually if I want to transfer a lot of files or very large files I'll sometimes take the SD card out and plug it into my desktop computer. It's a lot faster than copying them over the network.


ssh and ftp (FileZilla) from Desktop to Mobian - walter1950 - 05-19-2021

Hello quixote,







i just tried Desktop => Mobian (unstable) again:







ssh:





   









FileZilla:





FileZilla-Settings:





   









FileZilla final:



   







You get a two Way Connection with...





Maybe you have "overconfigurated" your Pinephone and should start from a new Flash ;-).






Yours



Sancho Panza ;-)
PS: Shitty Editor here :-(