Skip Navigation

How terminal in, on Android

Hi,

I created another user on my custom rom Android (aka Multiple users)

Unfortunately when doing so the system do not adapt the permission of the sdcard and some other directory, thus the new user can't access them :/

So I wanted to "remote" terminal into my android device from my computer.

How are you achieving this ? ( without 3thparty apps please ! )

Thanks.

10
10 comments
  • Thank you all for your input.. but it seem my question is still not fully answered...

    let me rephrase, I'm not looking to have a GUI to transfer files, but I would like to execute terminal command remotely (from my computer) to my android phone. Like SSH .

    So I've read that I can install a SSH server on my android phone.. (If you know some's (FLOSS), I'm all ears) Or if you know a better way than SSH I'm all ears too.

    Thanks.

    • I've found the most simple way (for my case) adb shell 'a command'

      example

      adb shell ls /
      
  • Each user gets their own partition in storage. So that user can see the SD card, just their partition in the card (whether internal or external).

    Same with the primary user - it can only see its own partition.

    If you have root, you can see these partitions as "user00", "user11", etc. From each user's perspective, the related partition is mounted as SDCard or SDCardExt (or something like that, depends on the phone).

    You can't remote into Android without a third party app, since Android doesn't natively host any remotely-accessable service (side note: this is part of what makes Linux more secure natively than Windows, and why we saw viruses on Windows - it natively has sharing services such as everything based on LanManager).

    If you want to have access to the file system over the network, you'd need to host a network file service, i.e. FTP, Samba/CIFS, etc, from within the user profile of the partition you'd like to access.

    If you want remote control, you'd need to use something like Rustdesk or ScrCpy.

    I enable file sharing between user partitions by installing SyncThing-Fork in both profiles, then creating a sync job in both user profiles. For example, Profile1 has a local folder called SyncToWorkProfile, that Syncthing uses with a sync job ("Folder" in Syncthing terminology), that's shared with the Syncthing Device ID of SyncThing in the Work Profile (and I do the same in the Work Profile). Those file system folders are unique to each partition - they're different folders, as different as folders on 2 different computers. SyncThing simply synchronizes files between devices - since it sees each installation of SyncThing as a separate device, those two folders are kept in sync.

    It would probably be more useful if you describe what you're trying to accomplish - then we can consider the different ways to achieve your goals.

You've viewed 10 comments.