debootstrap - chroot - a new user is bugged

New to Debian (Or Linux in general)? Ask your questions here!

debootstrap - chroot - a new user is bugged

Postby MagicPoulp » 2019-12-20 08:27

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: 227
Joined: 2018-11-05 21:30

Re: debootstrap - chroot - a new user is bugged

Postby MagicPoulp » 2019-12-20 08:33

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: 227
Joined: 2018-11-05 21:30

Re: debootstrap - chroot - a new user is bugged

Postby MagicPoulp » 2019-12-20 11:20

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: 227
Joined: 2018-11-05 21:30

Re: debootstrap - chroot - a new user is bugged

Postby MagicPoulp » 2019-12-20 11:39

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?
MagicPoulp
 
Posts: 227
Joined: 2018-11-05 21:30


Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 9 guests

fashionable