Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

debootstrap - chroot - a new user is bugged

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
MagicPoulp
Posts: 431
Joined: 2018-11-05 21:30

debootstrap - chroot - a new user is bugged

#1 Post by MagicPoulp »

Please help me with this issue.

I used debootstrap to install debian in a folder
I used chroot to open a shell in the folder.

the root user works perfectly.

I need help to create a new user. I created one but I cannot use sudo in it.
It cannot resolve my host untill I hard-code the host and its IP in /etc/hosts
Then I get an error when I use sudo. THe su command has many parameters but -u does not exist. Maybe it is the key command here.

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.

sudo: no tty present and no askpass program specified
a

-----------------------

Here is the exact list of commands I have run from scratch:

Code: Select all

sudo apt-get install debootstrap
sudo mkdir /stable-chroot
sudo chown myname:myname /stable-chroot
sudo debootstrap stable /stable-chroot http://deb.debian.org/debian/
sudo cd /stable-chroot/
sudo mount -t proc proc proc/
sudo mount --rbind /sys sys/
sudo mount --rbind /dev dev/
sudo chroot /stable-chroot/ /bin/bash

--> add a user
adduser appium
addgroup appium sudo
apt-get install sudo -y
su appium

MagicPoulp
Posts: 431
Joined: 2018-11-05 21:30

Re: debootstrap - chroot - a new user is bugged

#2 Post by MagicPoulp »

Could it be that the user lacks any of the basic groups my main user on the host has?

cdrom floppy sudo audio dip video plugdev kvm netdev scanner libvirt libvirt-qemu

Or what is the tty missing?

MagicPoulp
Posts: 431
Joined: 2018-11-05 21:30

Re: debootstrap - chroot - a new user is bugged

#3 Post by MagicPoulp »

sudo tries to open /dev/tty for read-write and prints that error if it fails. You’ve indicated in comments that /dev/tty is missing on your system.

so maybe I need to mount it. I thought I mounted dev.

MagicPoulp
Posts: 431
Joined: 2018-11-05 21:30

Re: debootstrap - chroot - a new user is bugged

#4 Post by MagicPoulp »

The problem disappeared.

I just had to follow my list of commands properly. After I have run debootstrap, I forgot to mount all the folders.


I still have somethign strange that I need to hardcode my host in /etc/hosts. but I can live with that.
If someone knows why it is necessary that would be nice
the shell says root@debian-myname
and it cannot resolve debian-myname when I run sudo


note that it does not not depend on the user, even root has this problem. Seems like the chroot change cannot resolve the outside host. But why?

Post Reply