LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Mobile
User Name
Password
Linux - Mobile This forum is for the discussion of all topics relating to Mobile Linux. This includes Android, Tizen, Sailfish OS, Replicant, Ubuntu Touch, webOS, and other similar projects and products.

Notices


Reply
  Search this Thread
Old 03-18-2022, 12:17 AM   #1
dchmelik
Senior Member
 
Registered: Nov 2008
Location: USA
Distribution: Slackware, FreeBSD, Illumos, NetBSD, DragonflyBSD, Plan9, Inferno, OpenBSD, FreeDOS, HURD
Posts: 1,066

Rep: Reputation: 147Reputation: 147
Question 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?

Last edited by dchmelik; 03-18-2022 at 04:36 AM.
 
Old 03-18-2022, 12:39 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,879

Rep: Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317
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 ????
 
Old 03-18-2022, 04:12 AM   #3
dchmelik
Senior Member
 
Registered: Nov 2008
Location: USA
Distribution: Slackware, FreeBSD, Illumos, NetBSD, DragonflyBSD, Plan9, Inferno, OpenBSD, FreeDOS, HURD
Posts: 1,066

Original Poster
Rep: Reputation: 147Reputation: 147
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...
 
Old 03-18-2022, 04:29 AM   #4
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,456
Blog Entries: 7

Rep: Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560
Android w/LAN/hosts/ssh/rsync?

SimpleSSHD for Android:
https://play.google.com/store/apps/d...hd&hl=en&gl=US
 
Old 03-18-2022, 04:35 AM   #5
dchmelik
Senior Member
 
Registered: Nov 2008
Location: USA
Distribution: Slackware, FreeBSD, Illumos, NetBSD, DragonflyBSD, Plan9, Inferno, OpenBSD, FreeDOS, HURD
Posts: 1,066

Original Poster
Rep: Reputation: 147Reputation: 147
Quote:
Originally Posted by rkelsen View Post
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.
 
Old 03-18-2022, 05:51 AM   #6
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,456
Blog Entries: 7

Rep: Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560
Android w/LAN/hosts/ssh/rsync?

How to use it the way you want:

https://www.reddit.com/r/Android/com...file_transfer/
 
1 members found this post helpful.
Old 03-18-2022, 05:57 AM   #7
dchmelik
Senior Member
 
Registered: Nov 2008
Location: USA
Distribution: Slackware, FreeBSD, Illumos, NetBSD, DragonflyBSD, Plan9, Inferno, OpenBSD, FreeDOS, HURD
Posts: 1,066

Original Poster
Rep: Reputation: 147Reputation: 147
Quote:
Originally Posted by rkelsen View Post
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.
 
Old 03-18-2022, 06:01 AM   #8
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,456
Blog Entries: 7

Rep: Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560
Android w/LAN/hosts/ssh/rsync?

I'm confused.
 
Old 03-18-2022, 06:25 AM   #9
dchmelik
Senior Member
 
Registered: Nov 2008
Location: USA
Distribution: Slackware, FreeBSD, Illumos, NetBSD, DragonflyBSD, Plan9, Inferno, OpenBSD, FreeDOS, HURD
Posts: 1,066

Original Poster
Rep: Reputation: 147Reputation: 147
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.)

Last edited by dchmelik; 03-18-2022 at 07:01 AM.
 
Old 03-18-2022, 07:09 AM   #10
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,456
Blog Entries: 7

Rep: Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560
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?

Last edited by rkelsen; 03-18-2022 at 07:12 AM.
 
1 members found this post helpful.
Old 03-18-2022, 07:49 AM   #11
dchmelik
Senior Member
 
Registered: Nov 2008
Location: USA
Distribution: Slackware, FreeBSD, Illumos, NetBSD, DragonflyBSD, Plan9, Inferno, OpenBSD, FreeDOS, HURD
Posts: 1,066

Original Poster
Rep: Reputation: 147Reputation: 147
Quote:
Originally Posted by rkelsen View Post
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.

Last edited by dchmelik; 03-18-2022 at 08:16 AM.
 
Old 03-18-2022, 07:50 AM   #12
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,879

Rep: Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317
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?
 
Old 03-18-2022, 08:15 AM   #13
dchmelik
Senior Member
 
Registered: Nov 2008
Location: USA
Distribution: Slackware, FreeBSD, Illumos, NetBSD, DragonflyBSD, Plan9, Inferno, OpenBSD, FreeDOS, HURD
Posts: 1,066

Original Poster
Rep: Reputation: 147Reputation: 147
Unhappy

Quote:
Originally Posted by pan64 View Post
[...] 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.

Last edited by dchmelik; 03-18-2022 at 09:19 AM.
 
Old 03-18-2022, 09:06 AM   #14
uteck
Senior Member
 
Registered: Oct 2003
Location: Elgin,IL,USA
Distribution: Ubuntu based stuff for the most part
Posts: 1,173

Rep: Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501
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

Last edited by uteck; 03-18-2022 at 09:08 AM. Reason: and second link
 
Old 03-18-2022, 09:18 AM   #15
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,879

Rep: Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317
Quote:
Originally Posted by dchmelik View Post
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 View Post
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Question on ssh authorization for rsync daemon server and rsync ssh shell framp Linux - Security 2 11-29-2021 09:47 AM
rsync over ssh VS rsync.d RISKS tripialos Linux - Security 4 02-20-2013 06:22 PM
[SOLVED] SSH no route to host error. can ssh outside lan, but not to clients on lan... jmd9qs Linux - Networking 3 01-21-2012 10:28 AM
[SOLVED] rsync fails in cron - ssh key prob for rsync? jonathansfl Linux - Server 6 12-09-2010 09:48 AM
Rsync server vs rsync over ssh humbletech99 Linux - Networking 1 10-18-2006 12:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Mobile

All times are GMT -5. The time now is 09:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration