why login registry auth.json always been cleared? #9454
-
In doker, there is no need to login again after initial login, but in podman the /run/user/0/containers/auth.json file always been cleared, then should login again and again. I'm not sure is a problem in podman or only my env has something wrong. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
@runseason good question. This is indeed one area where Podman differs from Docker and it was done on purpose to make your credentials more secure. As noted in the man page for podman login, the default location for the auth.json file where the credentials are stored is If you would prefer, you could move the credentials to another location where they won't be removed at logout using the Hope that helps! |
Beta Was this translation helpful? Give feedback.
-
Correct, you want the credentials to be stored permanently in a file then use REGISTRY_AUTH_FILE. From a security point of view the content of this file stores a username and password in slightly altered form, but easily translated. So storing them permanently in your Homedir or on an NFS share is in my opinion a horrible default. Putting them on /run gives us better UID protection for them, they never go out over the network for shared homedirs and they are destroyed when I log out of the system reboots. This was an intentional change from a security point of view. |
Beta Was this translation helpful? Give feedback.
@runseason good question. This is indeed one area where Podman differs from Docker and it was done on purpose to make your credentials more secure. As noted in the man page for podman login, the default location for the auth.json file where the credentials are stored is
${XDG_RUNTIME_DIR}/containers/auth.json
which is generally somewhere in the/run
directory tree,/run/user/{userid}
. As you're probably aware, files in the/run
directory are removed when you log out. We did this to make it a little harder for someone to grab them.If you would prefer, you could move the credentials to another location where they won't be removed at logout using the
podman login --authfile {file_location}
o…