Giter VIP home page Giter VIP logo

Comments (9)

 avatar commented on June 9, 2024 1

How to create a user other than root

useradd, then su/sudo for switching.

from proot-distro.

mukhtharcm avatar mukhtharcm commented on June 9, 2024

How to create a user other than root

useradd, then su/sudo for switching.

Is there any way to directly login to non root user?

from proot-distro.

 avatar commented on June 9, 2024

It's simple. you need to add the login command inside .bashrc file

eg:
echo "exec su - username" >> .bashrc

But I'm not sure there's a chance that if you type exit it keeps logging in back

from proot-distro.

 avatar commented on June 9, 2024

Is there any way to directly login to non root user?

I hope you have read the help information of proot-distro login - this command allows to redefine login command and use something else instead of just root shell.

Try something like proot-distro login ubuntu -- su - username

from proot-distro.

jj-sallo avatar jj-sallo commented on June 9, 2024

Try something like proot-distro login ubuntu -- su - username

This will result in tty errors, making it impossible to use programs like emacs and breaking things all around.

For example, trying to start emacs results in: emacs: Could not open file: /dev/tty

you need to add the login command inside .bashrc file

This works, but only when --termux-home is not specified.

Maybe adding a flag to login that switches --root-id to --change-id=uid:gid is a better option?

from proot-distro.

 avatar commented on June 9, 2024

This will result in tty errors

On your device maybe. Never seen such issue on any of mine.

trying to start emacs results in: emacs: Could not open file: /dev/tty

I can't reproduce that. Emacs works perfectly as well as /dev/tty accessible. See below:
screen

Maybe adding a flag to login that switches --root-id to --change-id=uid:gid is a better option?

su handles things better.

from proot-distro.

jj-sallo avatar jj-sallo commented on June 9, 2024

Seems like it's specific to Ubuntu-18.04.

Screenshot_20201117-204434~2

Worked fine in Ubuntu 20.04. Haven't tried other distros.

I also tried to add a --user flag to login as described before and it worked fine in Ubuntu-18.04. Will upload a fork to Github soon.

Why is su preferred, if I may ask?

from proot-distro.

 avatar commented on June 9, 2024

Why is su preferred, if I may ask?

Because su is alternate implementation of /bin/login, transparently configures appropriate environment vars for user and handles PAM modules.

from proot-distro.

vmobilez avatar vmobilez commented on June 9, 2024

proot-distro login --user username distro

example username eric, distro ubuntu-20.04

proot-distro login --user eric ubuntu-20.04

from proot-distro.

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.