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.

  • @[email protected]
    link
    fedilink
    English
    7
    edit-2
    19 days ago

    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.

    • chi-chan~
      link
      fedilink
      English
      219 days ago

      The first user (owner) is probably 0, and the second one be 10, and additional users after 10 would be 10+x (11, 12, 13…).

    • u/lukmly013 💾 (lemmy.sdf.org)
      link
      fedilink
      English
      119 days ago

      Android doesn’t natively host any remotely-accessable service

      What about ADB? It’s disabled by default, but can be used over network as well.

      • @[email protected]
        link
        fedilink
        English
        4
        edit-2
        19 days ago

        You can do things with ADB (like copy files, etc). In fact, ScrCpy uses it for remote control.

        You do have to enable developer options, then USB debugging, physically connect to a pc and authorize it (also enable permanent authorization and disable timeouts), etc. (I may forget a step or two there).

        I wouldn’t really consider it a native sharing system - as you said, it’s not enabled by default, and it’s a bit cumbersome. It’s a debugging utility that happens to enable remote debugging which can be used for other things with a bit of work. Not something I’d tell most people to use, because it’s cumbersome, and opens a security hole. It’s also a bit unstable. It tends to drop the network connection for no apparent reason.

        I use it to setup phones, because I can script a handful of app installs with it, or unlock the bootloader and flash a rom (or root the device).

        • @[email protected]
          link
          fedilink
          English
          219 days ago

          Almost easier to set up a share or ssh on the pc and use an easily installed app like Ghost Commander to connect and transfer.

          • @[email protected]
            link
            fedilink
            English
            118 days ago

            Yep.

            Or MixPlorer on the phone, which can host it’s own servers.

            But… Without root, it has to use the ephemeral port range, so no SMB from Windows to phone.

            I’ve used an FTP server on my phone from The Olive Tree since about 2014. I only run it when I need to copy/move stuff manually.

        • u/lukmly013 💾 (lemmy.sdf.org)
          link
          fedilink
          English
          119 days ago

          It’s also a bit unstable.

          Try to transfer files via MTP instead and then tell me what’s unstable.

          Anyway, the most reliable way of file transfer I found so far is KDE connect. Haven’t had that fail yet.

          • @[email protected]
            link
            fedilink
            English
            2
            edit-2
            18 days ago

            Lol, oh fuck MTP - that’s almost useless.

            Which is why I use apps like Syncthing, or MixPlorer (which can host it’s own servers for SMB, FTP, SFTP, FTPS, etc).

            It really depends on what I’m trying to do.