GithubHelp home page GithubHelp logo

Comments (11)

t184256 avatar t184256 commented on August 26, 2024

Have you tried setting one inside nix-on-droid with passwd?

from nix-on-droid.

Gerschtli avatar Gerschtli commented on August 26, 2024

In order to copy your key via ssh-copy-id, you need to already have a ssh key in ~/.ssh/authorized_keys present or the user password.

Unfortunately, passwd does not work for nix-on-droid, see:

bash-4.4$ nix run nixpkgs.shadow
bash-4.4$ passwd
passwd: pam_start() failed, error 26

Currently the only way to fix your problem would be to copy your via any other way onto your phone.

If you have ambitions you may have a look at termux patches for passwd, maybe we can adapt them to provide a working passwd.

from nix-on-droid.

573 avatar 573 commented on August 26, 2024

@Gerschtli thanks for the clarification.

from nix-on-droid.

APIPLM avatar APIPLM commented on August 26, 2024

@Gerschtli are your guys talking about that termux patches can be support a working version of passwd on nix-on-droid. But what I understand is that as long as we do not have root privilege, it almost impossible for us to run command like passwd.
But one thing is quite interesting is that we can build some tools related to root by nix-on-droid user but we can not run them by nix-on-droid user.

from nix-on-droid.

Gerschtli avatar Gerschtli commented on August 26, 2024

Termux indeed enables users to manage a password through various patches of binaries. They save the password manually in a different place and ensure that sshd and others are using the new password check functionality.

If someone wants to dig into these patches to port them, it would be a nice feature for nix-on-droid.

from nix-on-droid.

APIPLM avatar APIPLM commented on August 26, 2024

@Gerschtli same like saving passwd is related to the individual apps as I saw that they used to work on the pull request 2975 in the repo termux/termux-packages (termux/termux-packages#2975), they tried to have the branch like termux-auth, but finally they remove that.@xeffyr

from nix-on-droid.

 avatar commented on August 26, 2024

they tried to have the branch like termux-auth, but finally they remove that

Completely incorrect. Termux uses this library for password authentication (account-less) https://github.com/termux/termux-auth and patches authentication methods to use implementation from termux-auth. OpenSSH uses https://github.com/termux/termux-packages/blob/master/packages/openssh/auth2-passwd.c.patch#L18.

from nix-on-droid.

APIPLM avatar APIPLM commented on August 26, 2024

@xeffyr Thanks your point out. It like your guys decided to have a separate repo (termux/termux-auth) for password authentication (account-less), Inside the repo (termux/termux-packages) have build.sh and patches.
One thing question is that what is that meaning (account-less) in this context. What I understood is that, password is for the user who owner that termux . Let us say in my side, u0_a185 is the owner of termux as I saw by ps command. Thanks in advance.

from nix-on-droid.

 avatar commented on August 26, 2024

One thing question is that what is that meaning (account-less) in this context.

Nope. Password is set regardless of current account and is stored as PBKDF hash inside /data/data/com.termux/files/home/.termux_authinfo.

Same password is working for any user, no matter whether it is root, u0_a185 or other. Since auth is based on result whether PBKDF hash of input password matches the one from authinfo file, you need to make sure that user who runs the login service (say sshd) should have read access to that file.

On Android there no way to set a password for users because they are generated by libc. Just query some "nonexistent" user with id command (e.g. id 15000) and you will see that it actually exists.

from nix-on-droid.

APIPLM avatar APIPLM commented on August 26, 2024

@xeffyr Thanks. you are right. It doesn't matter the user, it is about IP address. whatever the string as user name like [email protected]. people can always to connect to sshd service running on 192.168.1.168 with the password ,which is managed by termux/termux-auth on termux.
On more point is that as we talked issues 82 with @t184256 in #82. What I find is that after install nix-on-droid, in the file /etc/passwd, we can see information the user root, nix-on-droid. like
root:X:0:0:System Administrator :/root:/bin/bash
nix-on-droid:X:10201:10201:nix-on-droid :/home:/nix/store/9m766yhgfghhj/bash

Maybe your guys can find more about information about that user on Android.

from nix-on-droid.

t184256 avatar t184256 commented on August 26, 2024

It's a 'fake' user record with a name nix-on-droid and some random user id that was assigned to the Nix-on-Droid app on installation time by the Android system.

from nix-on-droid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.