Ubuntu 16.04 lxc no tty present and no askpass program specifiedsudo: no tty present and no askpass program specified (trying to start apachectl)sudo [ no tty present and no askpass program specified ] [ can't stat /var/run/sudo: Permission denied ]x11vnc through SSH tunnel - sudo: no tty present and no askpass program specifiedDifferent behavior of ubuntu-cloud image between LXC and libvirt-lxcBest practices to avoid Jenkins error: sudo: no tty present and no askpass program specifiedRsync over SSH getting no tty presentUbuntu LXC 14.04 ErrorDeny usage of host consoles/ tty to lxc containerUbuntu: updated mainline kernel, now drops to initramfsUbuntu Server 16.04 tty console is out of bounds

Given 0s on Assignments with suspected and dismissed cheating?

Can anyone give me examples of the relative-determinative 'which'?

Why did the soldiers of the North disobey Jon?

Could a space colony 1g from the sun work?

Assembly writer vs compiler

Polynomial division: Is this trick obvious?

the correct order of manual install WP and SSL on server

Wireless headphones interfere with Wi-Fi signal on laptop

Do crew rest seats count towards the maximum allowed number of seats per flight attendant?

How could it be that 80% of townspeople were farmers during the Edo period in Japan?

Was the dragon prowess intentionally downplayed in S08E04?

How to continually let my readers know what time it is in my story, in an organic way?

Is the seat-belt sign activation when a pilot goes to the lavatory standard procedure?

Would life always name the light from their sun "white"

Using chord iii in a chord progression (major key)

Meaning of "legitimate" in Carl Jung's quote "Neurosis is always a substitute for legitimate suffering."

Why did Varys remove his rings?

How to handle professionally if colleagues has referred his relative and asking to take easy while taking interview

What dog breeds survive the apocalypse for generations?

How to not get blinded by an attack at dawn

What do the "optional" resistor and capacitor do in this circuit?

Is there an academic word that means "to split hairs over"?

Does the wearer know what items are in which patch in the Robe of Useful items?

What is this weird d12 for?



Ubuntu 16.04 lxc no tty present and no askpass program specified


sudo: no tty present and no askpass program specified (trying to start apachectl)sudo [ no tty present and no askpass program specified ] [ can't stat /var/run/sudo: Permission denied ]x11vnc through SSH tunnel - sudo: no tty present and no askpass program specifiedDifferent behavior of ubuntu-cloud image between LXC and libvirt-lxcBest practices to avoid Jenkins error: sudo: no tty present and no askpass program specifiedRsync over SSH getting no tty presentUbuntu LXC 14.04 ErrorDeny usage of host consoles/ tty to lxc containerUbuntu: updated mainline kernel, now drops to initramfsUbuntu Server 16.04 tty console is out of bounds






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I'm using Ubuntu 16.04 and lxc 2.0.7-0ubuntu1~16.04.1, I got this error sudo: no tty present and no askpass program specified in an unprivileged container( Ubuntu 16.04 amd64).



This is my /dev




ubuntu@unpc:~$ ls -al /dev/
total 4
drwxr-xr-x 6 root root 500 Feb 22 08:57 ./
drwxr-xr-x 21 root root 4096 Feb 22 04:15 ../
crw--w---- 1 root tty 136, 6 Feb 22 09:02 console
lrwxrwxrwx 1 root root 11 Feb 22 08:57 core -> /proc/kcore
lrwxrwxrwx 1 root root 13 Feb 22 08:57 fd -> /proc/self/fd/
crw-rw-rw- 1 nobody nogroup 1, 7 Feb 21 07:00 full
drwxr-xr-x 2 root root 40 Feb 22 08:57 hugepages/
lrwxrwxrwx 1 root root 25 Feb 22 08:57 initctl -> /run/systemd/initctl/fifo|
lrwxrwxrwx 1 root root 28 Feb 22 08:57 log -> /run/systemd/journal/dev-log=
drwxrwxrwt 2 nobody nogroup 40 Feb 22 08:57 mqueue/
crw-rw-rw- 1 nobody nogroup 1, 3 Feb 21 07:00 null
lrwxrwxrwx 1 root root 13 Feb 22 08:57 ptmx -> /dev/pts/ptmx
drwxr-xr-x 2 root root 0 Feb 22 08:57 pts/
crw-rw-rw- 1 nobody nogroup 1, 8 Feb 21 07:00 random
drwxrwxrwt 2 root root 40 Feb 22 08:57 shm/
lrwxrwxrwx 1 root root 15 Feb 22 08:57 stderr -> /proc/self/fd/2
lrwxrwxrwx 1 root root 15 Feb 22 08:57 stdin -> /proc/self/fd/0
lrwxrwxrwx 1 root root 15 Feb 22 08:57 stdout -> /proc/self/fd/1
crw-rw-rw- 1 nobody nogroup 5, 0 Feb 22 09:06 tty
crw--w---- 1 root tty 136, 0 Feb 22 09:02 tty1
crw--w---- 1 root tty 136, 1 Feb 22 09:02 tty2
crw--w---- 1 root tty 136, 2 Feb 22 09:02 tty3
crw--w---- 1 root tty 136, 3 Feb 22 09:02 tty4
crw-rw-rw- 1 nobody nogroup 1, 9 Feb 21 07:00 urandom
crw-rw-rw- 1 nobody nogroup 1, 5 Feb 21 07:00 zero









share|improve this question






















  • How did you log in to the container? Did you use SSH, or lxc exec?

    – ph0t0nix
    Apr 26 '17 at 8:55











  • I forget the details, I think it's lxc exec and got this error, so I have to modify sudoers, let the user use sudo without password.

    – dawncold
    Apr 26 '17 at 9:18

















0















I'm using Ubuntu 16.04 and lxc 2.0.7-0ubuntu1~16.04.1, I got this error sudo: no tty present and no askpass program specified in an unprivileged container( Ubuntu 16.04 amd64).



This is my /dev




ubuntu@unpc:~$ ls -al /dev/
total 4
drwxr-xr-x 6 root root 500 Feb 22 08:57 ./
drwxr-xr-x 21 root root 4096 Feb 22 04:15 ../
crw--w---- 1 root tty 136, 6 Feb 22 09:02 console
lrwxrwxrwx 1 root root 11 Feb 22 08:57 core -> /proc/kcore
lrwxrwxrwx 1 root root 13 Feb 22 08:57 fd -> /proc/self/fd/
crw-rw-rw- 1 nobody nogroup 1, 7 Feb 21 07:00 full
drwxr-xr-x 2 root root 40 Feb 22 08:57 hugepages/
lrwxrwxrwx 1 root root 25 Feb 22 08:57 initctl -> /run/systemd/initctl/fifo|
lrwxrwxrwx 1 root root 28 Feb 22 08:57 log -> /run/systemd/journal/dev-log=
drwxrwxrwt 2 nobody nogroup 40 Feb 22 08:57 mqueue/
crw-rw-rw- 1 nobody nogroup 1, 3 Feb 21 07:00 null
lrwxrwxrwx 1 root root 13 Feb 22 08:57 ptmx -> /dev/pts/ptmx
drwxr-xr-x 2 root root 0 Feb 22 08:57 pts/
crw-rw-rw- 1 nobody nogroup 1, 8 Feb 21 07:00 random
drwxrwxrwt 2 root root 40 Feb 22 08:57 shm/
lrwxrwxrwx 1 root root 15 Feb 22 08:57 stderr -> /proc/self/fd/2
lrwxrwxrwx 1 root root 15 Feb 22 08:57 stdin -> /proc/self/fd/0
lrwxrwxrwx 1 root root 15 Feb 22 08:57 stdout -> /proc/self/fd/1
crw-rw-rw- 1 nobody nogroup 5, 0 Feb 22 09:06 tty
crw--w---- 1 root tty 136, 0 Feb 22 09:02 tty1
crw--w---- 1 root tty 136, 1 Feb 22 09:02 tty2
crw--w---- 1 root tty 136, 2 Feb 22 09:02 tty3
crw--w---- 1 root tty 136, 3 Feb 22 09:02 tty4
crw-rw-rw- 1 nobody nogroup 1, 9 Feb 21 07:00 urandom
crw-rw-rw- 1 nobody nogroup 1, 5 Feb 21 07:00 zero









share|improve this question






















  • How did you log in to the container? Did you use SSH, or lxc exec?

    – ph0t0nix
    Apr 26 '17 at 8:55











  • I forget the details, I think it's lxc exec and got this error, so I have to modify sudoers, let the user use sudo without password.

    – dawncold
    Apr 26 '17 at 9:18













0












0








0








I'm using Ubuntu 16.04 and lxc 2.0.7-0ubuntu1~16.04.1, I got this error sudo: no tty present and no askpass program specified in an unprivileged container( Ubuntu 16.04 amd64).



This is my /dev




ubuntu@unpc:~$ ls -al /dev/
total 4
drwxr-xr-x 6 root root 500 Feb 22 08:57 ./
drwxr-xr-x 21 root root 4096 Feb 22 04:15 ../
crw--w---- 1 root tty 136, 6 Feb 22 09:02 console
lrwxrwxrwx 1 root root 11 Feb 22 08:57 core -> /proc/kcore
lrwxrwxrwx 1 root root 13 Feb 22 08:57 fd -> /proc/self/fd/
crw-rw-rw- 1 nobody nogroup 1, 7 Feb 21 07:00 full
drwxr-xr-x 2 root root 40 Feb 22 08:57 hugepages/
lrwxrwxrwx 1 root root 25 Feb 22 08:57 initctl -> /run/systemd/initctl/fifo|
lrwxrwxrwx 1 root root 28 Feb 22 08:57 log -> /run/systemd/journal/dev-log=
drwxrwxrwt 2 nobody nogroup 40 Feb 22 08:57 mqueue/
crw-rw-rw- 1 nobody nogroup 1, 3 Feb 21 07:00 null
lrwxrwxrwx 1 root root 13 Feb 22 08:57 ptmx -> /dev/pts/ptmx
drwxr-xr-x 2 root root 0 Feb 22 08:57 pts/
crw-rw-rw- 1 nobody nogroup 1, 8 Feb 21 07:00 random
drwxrwxrwt 2 root root 40 Feb 22 08:57 shm/
lrwxrwxrwx 1 root root 15 Feb 22 08:57 stderr -> /proc/self/fd/2
lrwxrwxrwx 1 root root 15 Feb 22 08:57 stdin -> /proc/self/fd/0
lrwxrwxrwx 1 root root 15 Feb 22 08:57 stdout -> /proc/self/fd/1
crw-rw-rw- 1 nobody nogroup 5, 0 Feb 22 09:06 tty
crw--w---- 1 root tty 136, 0 Feb 22 09:02 tty1
crw--w---- 1 root tty 136, 1 Feb 22 09:02 tty2
crw--w---- 1 root tty 136, 2 Feb 22 09:02 tty3
crw--w---- 1 root tty 136, 3 Feb 22 09:02 tty4
crw-rw-rw- 1 nobody nogroup 1, 9 Feb 21 07:00 urandom
crw-rw-rw- 1 nobody nogroup 1, 5 Feb 21 07:00 zero









share|improve this question














I'm using Ubuntu 16.04 and lxc 2.0.7-0ubuntu1~16.04.1, I got this error sudo: no tty present and no askpass program specified in an unprivileged container( Ubuntu 16.04 amd64).



This is my /dev




ubuntu@unpc:~$ ls -al /dev/
total 4
drwxr-xr-x 6 root root 500 Feb 22 08:57 ./
drwxr-xr-x 21 root root 4096 Feb 22 04:15 ../
crw--w---- 1 root tty 136, 6 Feb 22 09:02 console
lrwxrwxrwx 1 root root 11 Feb 22 08:57 core -> /proc/kcore
lrwxrwxrwx 1 root root 13 Feb 22 08:57 fd -> /proc/self/fd/
crw-rw-rw- 1 nobody nogroup 1, 7 Feb 21 07:00 full
drwxr-xr-x 2 root root 40 Feb 22 08:57 hugepages/
lrwxrwxrwx 1 root root 25 Feb 22 08:57 initctl -> /run/systemd/initctl/fifo|
lrwxrwxrwx 1 root root 28 Feb 22 08:57 log -> /run/systemd/journal/dev-log=
drwxrwxrwt 2 nobody nogroup 40 Feb 22 08:57 mqueue/
crw-rw-rw- 1 nobody nogroup 1, 3 Feb 21 07:00 null
lrwxrwxrwx 1 root root 13 Feb 22 08:57 ptmx -> /dev/pts/ptmx
drwxr-xr-x 2 root root 0 Feb 22 08:57 pts/
crw-rw-rw- 1 nobody nogroup 1, 8 Feb 21 07:00 random
drwxrwxrwt 2 root root 40 Feb 22 08:57 shm/
lrwxrwxrwx 1 root root 15 Feb 22 08:57 stderr -> /proc/self/fd/2
lrwxrwxrwx 1 root root 15 Feb 22 08:57 stdin -> /proc/self/fd/0
lrwxrwxrwx 1 root root 15 Feb 22 08:57 stdout -> /proc/self/fd/1
crw-rw-rw- 1 nobody nogroup 5, 0 Feb 22 09:06 tty
crw--w---- 1 root tty 136, 0 Feb 22 09:02 tty1
crw--w---- 1 root tty 136, 1 Feb 22 09:02 tty2
crw--w---- 1 root tty 136, 2 Feb 22 09:02 tty3
crw--w---- 1 root tty 136, 3 Feb 22 09:02 tty4
crw-rw-rw- 1 nobody nogroup 1, 9 Feb 21 07:00 urandom
crw-rw-rw- 1 nobody nogroup 1, 5 Feb 21 07:00 zero






ubuntu sudo lxc






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Feb 22 '17 at 9:09









dawncolddawncold

188




188












  • How did you log in to the container? Did you use SSH, or lxc exec?

    – ph0t0nix
    Apr 26 '17 at 8:55











  • I forget the details, I think it's lxc exec and got this error, so I have to modify sudoers, let the user use sudo without password.

    – dawncold
    Apr 26 '17 at 9:18

















  • How did you log in to the container? Did you use SSH, or lxc exec?

    – ph0t0nix
    Apr 26 '17 at 8:55











  • I forget the details, I think it's lxc exec and got this error, so I have to modify sudoers, let the user use sudo without password.

    – dawncold
    Apr 26 '17 at 9:18
















How did you log in to the container? Did you use SSH, or lxc exec?

– ph0t0nix
Apr 26 '17 at 8:55





How did you log in to the container? Did you use SSH, or lxc exec?

– ph0t0nix
Apr 26 '17 at 8:55













I forget the details, I think it's lxc exec and got this error, so I have to modify sudoers, let the user use sudo without password.

– dawncold
Apr 26 '17 at 9:18





I forget the details, I think it's lxc exec and got this error, so I have to modify sudoers, let the user use sudo without password.

– dawncold
Apr 26 '17 at 9:18










1 Answer
1






active

oldest

votes


















0














I had a similar problem.



This is what solved for me.



Add this to your config:



# /dev/console
lxc.cgroup.devices.allow = c 5:1 rwm
# /dev/ptmx
lxc.cgroup.devices.allow = c 5:2 rwm
# /dev/pts/*
lxc.cgroup.devices.allow = c 136:* rwm
# /dev/tty
lxc.cgroup.devices.allow = c 5:0 rwm


Reference: https://lists.linuxcontainers.org/pipermail/lxc-users/2012-January/003150.html






share|improve this answer























  • Thanks rsd, but I got an error: lxc_cgfsng - cgroups/cgfsng.c:cgfsng_setup_limits:1949 - No such file or directory - Error setting devices.allow to c 5:1 rwm for unpc, I confirmed there is a char device with marjor number 5 and minor number 1

    – dawncold
    Jun 14 '17 at 1:54











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f834125%2fubuntu-16-04-lxc-no-tty-present-and-no-askpass-program-specified%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














I had a similar problem.



This is what solved for me.



Add this to your config:



# /dev/console
lxc.cgroup.devices.allow = c 5:1 rwm
# /dev/ptmx
lxc.cgroup.devices.allow = c 5:2 rwm
# /dev/pts/*
lxc.cgroup.devices.allow = c 136:* rwm
# /dev/tty
lxc.cgroup.devices.allow = c 5:0 rwm


Reference: https://lists.linuxcontainers.org/pipermail/lxc-users/2012-January/003150.html






share|improve this answer























  • Thanks rsd, but I got an error: lxc_cgfsng - cgroups/cgfsng.c:cgfsng_setup_limits:1949 - No such file or directory - Error setting devices.allow to c 5:1 rwm for unpc, I confirmed there is a char device with marjor number 5 and minor number 1

    – dawncold
    Jun 14 '17 at 1:54















0














I had a similar problem.



This is what solved for me.



Add this to your config:



# /dev/console
lxc.cgroup.devices.allow = c 5:1 rwm
# /dev/ptmx
lxc.cgroup.devices.allow = c 5:2 rwm
# /dev/pts/*
lxc.cgroup.devices.allow = c 136:* rwm
# /dev/tty
lxc.cgroup.devices.allow = c 5:0 rwm


Reference: https://lists.linuxcontainers.org/pipermail/lxc-users/2012-January/003150.html






share|improve this answer























  • Thanks rsd, but I got an error: lxc_cgfsng - cgroups/cgfsng.c:cgfsng_setup_limits:1949 - No such file or directory - Error setting devices.allow to c 5:1 rwm for unpc, I confirmed there is a char device with marjor number 5 and minor number 1

    – dawncold
    Jun 14 '17 at 1:54













0












0








0







I had a similar problem.



This is what solved for me.



Add this to your config:



# /dev/console
lxc.cgroup.devices.allow = c 5:1 rwm
# /dev/ptmx
lxc.cgroup.devices.allow = c 5:2 rwm
# /dev/pts/*
lxc.cgroup.devices.allow = c 136:* rwm
# /dev/tty
lxc.cgroup.devices.allow = c 5:0 rwm


Reference: https://lists.linuxcontainers.org/pipermail/lxc-users/2012-January/003150.html






share|improve this answer













I had a similar problem.



This is what solved for me.



Add this to your config:



# /dev/console
lxc.cgroup.devices.allow = c 5:1 rwm
# /dev/ptmx
lxc.cgroup.devices.allow = c 5:2 rwm
# /dev/pts/*
lxc.cgroup.devices.allow = c 136:* rwm
# /dev/tty
lxc.cgroup.devices.allow = c 5:0 rwm


Reference: https://lists.linuxcontainers.org/pipermail/lxc-users/2012-January/003150.html







share|improve this answer












share|improve this answer



share|improve this answer










answered Jun 14 '17 at 0:46









rsdrsd

312




312












  • Thanks rsd, but I got an error: lxc_cgfsng - cgroups/cgfsng.c:cgfsng_setup_limits:1949 - No such file or directory - Error setting devices.allow to c 5:1 rwm for unpc, I confirmed there is a char device with marjor number 5 and minor number 1

    – dawncold
    Jun 14 '17 at 1:54

















  • Thanks rsd, but I got an error: lxc_cgfsng - cgroups/cgfsng.c:cgfsng_setup_limits:1949 - No such file or directory - Error setting devices.allow to c 5:1 rwm for unpc, I confirmed there is a char device with marjor number 5 and minor number 1

    – dawncold
    Jun 14 '17 at 1:54
















Thanks rsd, but I got an error: lxc_cgfsng - cgroups/cgfsng.c:cgfsng_setup_limits:1949 - No such file or directory - Error setting devices.allow to c 5:1 rwm for unpc, I confirmed there is a char device with marjor number 5 and minor number 1

– dawncold
Jun 14 '17 at 1:54





Thanks rsd, but I got an error: lxc_cgfsng - cgroups/cgfsng.c:cgfsng_setup_limits:1949 - No such file or directory - Error setting devices.allow to c 5:1 rwm for unpc, I confirmed there is a char device with marjor number 5 and minor number 1

– dawncold
Jun 14 '17 at 1:54

















draft saved

draft discarded
















































Thanks for contributing an answer to Server Fault!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f834125%2fubuntu-16-04-lxc-no-tty-present-and-no-askpass-program-specified%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Wikipedia:Vital articles Мазмуну Biography - Өмүр баян Philosophy and psychology - Философия жана психология Religion - Дин Social sciences - Коомдук илимдер Language and literature - Тил жана адабият Science - Илим Technology - Технология Arts and recreation - Искусство жана эс алуу History and geography - Тарых жана география Навигация менюсу

Bruxelas-Capital Índice Historia | Composición | Situación lingüística | Clima | Cidades irmandadas | Notas | Véxase tamén | Menú de navegacióneO uso das linguas en Bruxelas e a situación do neerlandés"Rexión de Bruxelas Capital"o orixinalSitio da rexiónPáxina de Bruselas no sitio da Oficina de Promoción Turística de Valonia e BruxelasMapa Interactivo da Rexión de Bruxelas-CapitaleeWorldCat332144929079854441105155190212ID28008674080552-90000 0001 0666 3698n94104302ID540940339365017018237

What should I write in an apology letter, since I have decided not to join a company after accepting an offer letterShould I keep looking after accepting a job offer?What should I do when I've been verbally told I would get an offer letter, but still haven't gotten one after 4 weeks?Do I accept an offer from a company that I am not likely to join?New job hasn't confirmed starting date and I want to give current employer as much notice as possibleHow should I address my manager in my resignation letter?HR delayed background verification, now jobless as resignedNo email communication after accepting a formal written offer. How should I phrase the call?What should I do if after receiving a verbal offer letter I am informed that my written job offer is put on hold due to some internal issues?Should I inform the current employer that I am about to resign within 1-2 weeks since I have signed the offer letter and waiting for visa?What company will do, if I send their offer letter to another company