LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Mobile (https://www.linuxquestions.org/questions/linux-mobile-81/)
-   -   Android w/LAN/hosts/ssh/rsync? (https://www.linuxquestions.org/questions/linux-mobile-81/android-w-lan-hosts-ssh-rsync-4175709604/)

dchmelik 03-18-2022 12:17 AM

Android w/LAN/hosts/ssh/rsync?
 
How would I setup an (rooted) Android PC to use on my LAN, including installing an /etc/hosts (or equivalent) on it and SSH keys so I can rsync user data to it?

pan64 03-18-2022 12:39 AM

I don't know the answer. Mainly because I have no idea which device is it, what OS is running now on it. How can you connect it to your LAN? What do you mean by your LAN at all?
Do you have a connection problem or ssh related issue, or rsync or ????

dchmelik 03-18-2022 04:12 AM

Stock Android 8, soon to be updated to 9 or a custom ROM fork of Android 11, and an Android 11 or 12 devices later...

rkelsen 03-18-2022 04:29 AM

Android w/LAN/hosts/ssh/rsync?
 
SimpleSSHD for Android:
https://play.google.com/store/apps/d...hd&hl=en&gl=US

dchmelik 03-18-2022 04:35 AM

Quote:

Originally Posted by rkelsen (Post 6339390)

Good; SSHD on Android might be nice, but for me, maybe overkill; I just want my ssh keys in my 'home' folder and Android PC system-wide hosts file to use rsync to copy from other hosts on LAN.

rkelsen 03-18-2022 05:51 AM

Android w/LAN/hosts/ssh/rsync?
 
How to use it the way you want:

https://www.reddit.com/r/Android/com...file_transfer/

dchmelik 03-18-2022 05:57 AM

Quote:

Originally Posted by rkelsen (Post 6339406)

That's good, but I usually rsync to a host I'm on from a remote host, even if it'll be a little harder typing on the Android. Some directory/folder names are different or in a different place, and it's easier to specify those on the host being copied to.

rkelsen 03-18-2022 06:01 AM

Android w/LAN/hosts/ssh/rsync?
 
I'm confused.

dchmelik 03-18-2022 06:25 AM

If I SSH/rsync on Android, I'll be typing in Android (said this already) shell and SSH to desktop/server or rsync, in Android shell, files from desktop/server to Android; stated don't need SSHD on Android.  I t'd be like below.

Code:

user@android~# ssh user@desktop
user@desktop~# ls
user@desktop~# exit
user@android~# scp -r user@desktop:books .
or
user@android~# rsync -av user@desktop:books .

        I don't know where user's home folder nor system-wide hosts file are on Android (I'd rather type hostname than 192.168.1.101.)

rkelsen 03-18-2022 07:09 AM

Android w/LAN/hosts/ssh/rsync?
 
Well Android doesn't follow the FHS. But on my phone, the hosts file is /etc/hosts. You could look under /system/etc/hosts perhaps?

Which direction are you trying to copy files? To Android or from Android? And do you want to use the Android shell or not?

dchmelik 03-18-2022 07:49 AM

Quote:

Originally Posted by rkelsen (Post 6339423)
Well Android doesn't follow the FHS. But on my phone, the hosts file is /etc/hosts. You could look under /system/etc/hosts perhaps?

It's there but read-only even for root. :(

Quote:

Which direction are you trying to copy files? To Android or from Android? And do you want to use the Android shell or not?
I wrote that out in complete detail above. I recall that some Android terminal emulators have shells and packages such as rsync, so I installed that but will have to write the full IP address... at least it's easier than the broken connection software in KDE/dolphin.
        However, apparently the Android terminal I used installs rsync in an unprivileged user's chroot, but root owns SD card and can't use that rsync (at least without a lot of unknown configuration.)
        Android is a mess!
        I might have to end up doing what you linked even though the command-line is a bit more complicated.

pan64 03-18-2022 07:50 AM

there are a lot of ready-made android apps to do that, do not need to implement anything. I don't understand what is it all about?

dchmelik 03-18-2022 08:15 AM

Quote:

Originally Posted by pan64 (Post 6339433)
[...] I don't understand what is it all about?

Then don't answer; I'm a Unix & Slackware user here who was being helped by a Slackware user, and we know what it's about.
        I may end up doing what rkelsen linked, but that was about copying it from Android to destkop/server, opposite of what I wanted to do.
        Despite all the 'apps' you didn't describe, sometimes command-line is nicer.

uteck 03-18-2022 09:06 AM

If you have not found the user home directory yet, according to this site, https://www.thesecmaster.com/explore...rchy-in-depth/ it is in /data.
This link gives a few ways to edit the /etc/hosts file; https://www.modmy.com/how-modify-hos...android-device

pan64 03-18-2022 09:18 AM

Quote:

Originally Posted by dchmelik (Post 6339442)
Then don't answer; I'm a Unix & Slackware user here who was being helped by a Slackware user, and we know what it's about.

what a polite approach (from a slack guy). I guess you need to formulate a better question to be able to help you. It is you, who want to solve an issue, not me. I wanted to ask why do you want to reinvent the wheel, why don't you use an already existing solution? What is missing. But I don't care/don't ask any more.
Quote:

Originally Posted by dchmelik (Post 6339442)
Despite all the 'apps' you didn't describe, sometimes command-line is nicer.

You can find a lot of ssh/scp/sftp clients for android, I guess I don't need to describe it better.


All times are GMT -5. The time now is 04:19 PM.