linuxkit / lcow

Linux containers on Windows built with LinuxKit
Apache License 2.0
224 stars 42 forks source link

sudo: pam_open_session: Permission denied #48

Open solvingj opened 5 years ago

solvingj commented 5 years ago

After building the following Dockerfile, the container cannot use sudo due to PAM issue:

FROM opensuse/leap:42.3

RUN zypper --non-interactive install \
    sudo

#fix bug: https://github.com/openSUSE/docker-containers/issues/82
RUN sed -i 's/.*root.*-.*nproc.*unlimited.*$//g' /etc/security/limits.conf

CMD sudo ls
docker build . -t leap-pam-issue
docker run --rm leap-pam-issue
sudo: pam_open_session: Permission denied
sudo: policy plugin failed session initialization

This was on OpenSUSE, might also affect Centos/rhel related images.

Original: https://github.com/openSUSE/docker-containers/issues/82#issuecomment-494416167