Comments (9)
How to create a user other than root
useradd
, then su
/sudo
for switching.
from proot-distro.
How to create a user other than root
useradd
, thensu
/sudo
for switching.
Is there any way to directly login to non root user?
from proot-distro.
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.
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.
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.
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:
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.
Seems like it's specific to Ubuntu-18.04.
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.
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.
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)
- [Feature]: proot-distro --user-chroot or chroot-distro HOT 2
- [Feature]: Keep "/etc/environment" HOT 3
- [Bug]: HOT 2
- [Bug]: Ubuntu 23.04 is not LTS and its life ended HOT 2
- [Distribution]: ubuntu-oldlts (Ubuntu 22.04 LTS) HOT 2
- [Bug]: Alpine Linux: doas refuse to give user permission, even though reading Alpine wiki's "Setting up a new user" very carefully. HOT 2
- Permissions on bind mount of external SD card in proot-distro HOT 1
- [Bug]: Script: incorrect name of ubuntu release in distro-plugins/ubuntu-lts.sh and distro-plugins/ubuntu-oldlts.sh
- [Feature]: Using Termux Vulkan-Loaer with PRoot-Dsitro HOT 7
- Consider faking or disabling certain sysfs mountpoints HOT 1
- [Bug]: can't install arm distributions on termux arm64 HOT 2
- Apache2 not start After upgrade or fresh install PHP 8.3 HOT 2
- [Bug]: new user in Arch not in wheel group after logging in HOT 1
- [Distribution]: Ubuntu 24.04 (Noble Numbat) HOT 2
- Sorry, I was having a hard time getting the error message again. HOT 1
- [Feature]: accept argument to set working directory through `--cwd` HOT 2
- [Feature]: argument `--env` to set environment variable HOT 2
- [Bug]: proot-distro not updated in termux repository ? HOT 1
- [Distribution]:freebsd HOT 1
- [Bug]: the xfce pulseaudio plugin not working in Debian HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from proot-distro.