I have a docker file where I have customized image myimage derived from some-debian-image (which derived from debian upstream.)

FROM some-debian-image myimge USERNAME root:root ........................... RUN chsh -s /bin/bash ${USERNAME} 

docker build fails saying :

Password: chsh: PAM: Authentication failure 

However, it does not fail with upstream

FROM bebain:bullseye myimage USERNAME root:root ........................... RUN chsh -s /bin/bash ${USERNAME} 

Developers who have build the some-debian-image have done something add on with /etc/passwd , and it is having content

root:x:0:0:root:/root:/usr/sbin/nologin 

May I please know how to successfully run this command :

RUN chsh -s /bin/bash ${USERNAME} 

I am comparing docker images setup where it is working and where it is not working , and I found that:

The setup where the above command RUN chsh -s /bin/bash ${USERNAME} is working sudo su can be expected without any password

$ sudo su # 

In contrast in setup where I am facing issue ask for password when run the command sudo su

May I pleas know what changes I should do so that sudo su shall not ask for password?

4

Related questions 6 docker run sed doesn't work 0 docker login in shell script dont work 83 Why does Docker say it can't execute 'bash"? Related questions 6 docker run sed doesn't work 0 docker login in shell script dont work 83 Why does Docker say it can't execute 'bash"? 3 Docker container does not give me a shell 0 Unable to run shell script using dockerfile 0 bash file in docker isn't executing 3 bash does not work using Docker's SHELL instruction 1 docker-machine ssh trying to run part of command on local machine 2 /bin/bash gives me the error inside docker container 3 Shell command won't run in Docker build Load 7 more related questions Show fewer related questions

Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.