Hello. root was used to ssh remote server to run docker run --user mysql mysql:8.0 ..., but
when ls -l
-rw-r----- 1 polkitd input 56 Sep 25 05:02 auto.cnf
-rw------- 1 polkitd input 1679 Sep 25 05:02 ca-key.pem
-rw-r--r-- 1 polkitd input 1107 Sep 25 05:02 ca.pem
-rw-r--r-- 1 polkitd input 1107 Sep 25 05:02 client-cert.pem
-rw------- 1 polkitd input 1679 Sep 25 05:02 client-key.pem
-rw-r----- 1 polkitd input 1341 Sep 25 05:03 ib_buffer_pool
...
when ps -ef|grep mysql
polkitd 29903 29886 0 05:00 ? 00:00:01 mysqld
Please have a look at the polkitd input, the owner is not root or mysql, which lead to uncontrollable user and permission. What should I do to solve it?
This has nothing to do with paramiko, this is a docker and linux containers thing. The filesystem just uses numbers to refer to users and groups which own files, and these numbers are mapped in /etc/passwd and /etc/group. The user "mysql" inside the docker container has the same uid (number) as the user "polkitd" outside the docker container (the host server).
@ploxiln Thank you so much. I tested docker run mysql:8.0 ... on the host server with --user mysql:mysql and --user root:root directly, it didn't work, but --user ${uid}:${gid} worked.
I think it's mysql image's problem, because I never see polkitd before, the default owner of the docker container is root, right?
This has nothing to do with paramiko, this is a docker and linux containers thing. The filesystem just uses numbers to refer to users and groups which own files, and these numbers are mapped in
/etc/passwdand/etc/group. The user "mysql" inside the docker container has the same uid (number) as the user "polkitd" outside the docker container (the host server).
I have similar situation with redis now
Most helpful comment
This has nothing to do with paramiko, this is a docker and linux containers thing. The filesystem just uses numbers to refer to users and groups which own files, and these numbers are mapped in
/etc/passwdand/etc/group. The user "mysql" inside the docker container has the same uid (number) as the user "polkitd" outside the docker container (the host server).