Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error using chpasswd with host networking and ubuntu:14.04 image #5704

Closed
sameersbn opened this issue May 9, 2014 · 25 comments
Closed

error using chpasswd with host networking and ubuntu:14.04 image #5704

sameersbn opened this issue May 9, 2014 · 25 comments

Comments

@sameersbn
Copy link

when using chpasswd command on the ubuntu:14.04 image with and without host networking yields different results.

without host networking there is not issue using the chpasswd command

docker run -i -t --rm  ubuntu:14.04 bash
echo "root:secretpasswod" | chpasswd

with host networking the chpasswd command doesn't work

docker run -i -t --rm --net='host' ubuntu:14.04 bash
echo "root:secretpasswod" | chpasswd
chpasswd: (user root) pam_chauthtok() failed, error:
System error
chpasswd: (line 1, user root) password not changed
@JasonSwindle
Copy link

I just ran into this as well. Did you find a work-around?

@sameersbn
Copy link
Author

no i did not. to be completely frank i did not try a lot since it works without --net host.

@JasonSwindle
Copy link

I just changed to 12.04 to get around it...
On May 15, 2014 11:22 AM, "Sameer Naik" notifications@github.com wrote:

no i did not. to be completely frank i did not try a lot since it works
without --net host.


Reply to this email directly or view it on GitHubhttps://github.com//issues/5704#issuecomment-43231916
.

@sameersbn
Copy link
Author

oh yes.. sorry for not mentioning that in the issue report.
An image of mine had some trouble running on rhel 6.5 + selinux, so one of the contributors upgraded to 14.04 to fix the issue.

@mkscrg
Copy link

mkscrg commented May 19, 2014

This and #5899 are likely the same issue.

@ErikGrimes
Copy link

/sub

@pandeiro
Copy link

pandeiro commented Jul 6, 2014

Is there any update on this? Trying to install postgresql on ubuntu:14.04 --

FROM ubuntu:14.04
RUN apt-get update -qq
RUN apt-get install -y postgresql

-- incurs this problem as well. The specific error output follows:

> Setting up postgresql-common (154) ...
chfn: PAM: System error
adduser: `/usr/bin/chfn -f PostgreSQL administrator postgres' returned error code 1. Exiting.

Any fix for this?

@sameersbn
Copy link
Author

@pandeiro use of chpasswd on a ubuntu:14.04 base with host networking enabled shows this issue. Either you disable host networking or base your image on ubuntu:12.04.

@tiborvass
Copy link
Contributor

I could not reproduce the issue with docker 1.1.0.
If someone can, could they please paste the output of docker version and docker info ?

@pandeiro
Copy link

pandeiro commented Jul 7, 2014

The issue continues affecting me with Ubuntu 14.04 and Host networking on Arch Linux with Docker 1.1.0:

# version
Client version: 1.1.0
Client API version: 1.13
Go version (client): go1.3
Git commit (client): 79812e3
Server version: 1.1.0
Server API version: 1.13
Go version (server): go1.3
Git commit (server): 79812000

# info
Containers: 6
Images: 413
Storage Driver: devicemapper
 Pool Name: docker-202:0-232463-pool
 Data file: /var/lib/docker/devicemapper/devicemapper/data
 Metadata file: /var/lib/docker/devicemapper/devicemapper/metadata
 Data Space Used: 10736.4 Mb
 Data Space Total: 102400.0 Mb
 Metadata Space Used: 19.8 Mb
 Metadata Space Total: 2048.0 Mb
Execution Driver: native-0.2
Kernel Version: 3.15.3-x86_64-linode44
WARNING: No memory limit support
WARNING: No swap limit support

@sameersbn
Copy link
Author

@tiborvass I am sorry for my previous comment. I forgot to enable host networking

# docker run -i -t --rm --net='host' ubuntu:14.04 bash
root@VAIO:/# echo "root:secretpasswod" | chpasswd
chpasswd: (user root) pam_chauthtok() failed, error:
System error
chpasswd: (line 1, user root) password not changed
# docker version
Client version: 1.1.0
Client API version: 1.13
Go version (client): go1.2.1
Git commit (client): 79812e3
Server version: 1.1.0
Server API version: 1.13
Go version (server): go1.2.1
Git commit (server): 79812000

# docker info
Containers: 7
Images: 234
Storage Driver: aufs
 Root Dir: /media/vbox/docker/graphs/aufs
 Dirs: 249
Execution Driver: native-0.2
Kernel Version: 3.13.0-30-generic
Username: sameersbn
Registry: [https://index.docker.io/v1/]
WARNING: No swap limit support

deleting my previous comment to avoid any confusion..

@tiborvass
Copy link
Contributor

@sameersbn Thanks, I could reproduce this on Ubuntu trusty with docker 1.1.1.

@zonorti
Copy link

zonorti commented Jul 29, 2014

Docker 1.1.2 and centos:latest - issue looks much alike:

root@docker9b2790143:~# docker run -i -t  centos /bin/bash
bash-4.2# useradd test
bash-4.2# su - test
[test@67a1a3f20796 ~]$ id
uid=1000(test) gid=1000(test) groups=1000(test)
[test@67a1a3f20796 ~]$ logout
bash-4.2# exit
root@docker9b2790143:~# docker run -i -t --net=host centos /bin/bash
bash-4.2# useradd test
bash-4.2# su - test
su: System error

Host is 14.04

Linux docker9b2790143 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

Is there any temporary workarounds?
The one in #6345 doen not help.

@LK4D4
Copy link
Contributor

LK4D4 commented Jul 29, 2014

@imelnik It's working for me in master

@zonorti
Copy link

zonorti commented Jul 29, 2014

@LK4D4, I've checked against master and it's still the same.
Probably it it another issue.

root@dockerbff6e0144:~# docker version
Client version: 1.1.2-dev
Client API version: 1.14
Go version (client): go1.3
Git commit (client): 3369b4f
OS/Arch (client): linux/amd64
Server version: 1.1.2-dev
Server API version: 1.14
Go version (server): go1.3
Git commit (server): 3369b4f
root@dockerbff6e0144:~# docker run -i -t --net=host centos /bin/bash
bash-4.2# adduser test
bash-4.2# su test  
su: System error
bash-4.2# id
uid=0(root) gid=0(root) groups=0(root)

@larrycai
Copy link

I met this problem in docker hub for build random, it doesn't happen locally, see https://registry.hub.docker.com/u/larrycai/jenkins-slave/build_id/5359/code/b2etjmnbcjyhkykgmn96rd9/

@zonorti
Copy link

zonorti commented Jul 30, 2014

@larrycai your link is private (Sorry, you don't have access to this page.)
I'm getting this error at runtime.
Also passwd fails.
Any idea on debugging?

@larrycai
Copy link

haven't noticed the build history is private, I don't know how to debug since this is official one, maybe docker ops team can provide more information for this. The Dockerfile is https://github.com/larrycai/docker-images/blob/50c2dfddc248dbad776137a6b430052a1348a198/jenkins-slave/Dockerfile (not latest commit), it was failure for build first time, and it works after rebuild it manually.

paste error log below

Step 8 : RUN echo "jenkins:jenkins" | chpasswd 
---> Running in 4108a331d4e7 
�[91mchpasswd: (user jenkins) pam_chauthtok() failed, error:
System error
�[0m 
�[91mchpasswd: (line 1, user jenkins) password not changed
�[0m 
The command [/bin/sh -c echo "jenkins:jenkins" | chpasswd] returned a non-zero code: 1

@jemc
Copy link

jemc commented Jul 31, 2014

Looks like this is a problem with the 3.15 linux kernel.
I "fixed" it by reverting back to my last installed kernel, 3.11.

@benley
Copy link

benley commented Oct 9, 2014

I'm now experiencing this with linux 3.13, for what it's worth. Host system is Ubuntu 14.04, docker image is also based on ubuntu:14.04.

@zonorti
Copy link

zonorti commented Oct 9, 2014

@benley try to use base images from - https://github.com/sequenceiq/docker-pam - they fixed this bug at image side.

@jessfraz
Copy link
Contributor

this is fixed on master

jessie at debian in ~
$ docker run -i -t --rm  ubuntu:14.04 bash
root@02dbaa0ea2ba:/# echo "root:secretpasswod" | chpasswd
root@02dbaa0ea2ba:/# exit
exit

jessie at debian in ~
$ docker run -i -t --rm --net='host' ubuntu:14.04 bash
root@debian:/# echo "root:secretpasswod" | chpasswd
root@debian:/# exit
exit

@teraproc
Copy link

teraproc commented Sep 4, 2015

I met the same issue in the latest ubuntu:14.04 image as follows. Any idea?

root@olnode1:# docker run -i -t --rm --net='host' ubuntu:14.04 bash
root@olnode1:/# echo "root:secretpasswod" | chpasswd
chpasswd: (user root) pam_chauthtok() failed, error:
System error
chpasswd: (line 1, user root) password not changed
root@olnode1:
# docker -v
Docker version 1.7.1, build 786b29d

@ghost
Copy link

ghost commented Feb 11, 2018

Just having this happen with kernel 4.14 and docker 1.13.1. Are there any workarounds? I'm not using host networking either...

@AlexeyPlodenko
Copy link

For those coming from the search engines...

In my case the password was too simple and needed to use a stronger one, using the capital and small letters, digits and symbols. For ex, P2sswrd!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests