github.com/containers/podman/v5@v5.1.0-rc1/docs/source/markdown/podman-login.1.md.in (about) 1 % podman-login 1 2 3 ## NAME 4 podman\-login - Log in to a container registry 5 6 ## SYNOPSIS 7 **podman login** [*options*] [*registry*] 8 9 ## DESCRIPTION 10 **podman login** logs into a specified registry server with the correct username 11 and password. If the registry is not specified, the first registry under [registries.search] 12 from registries.conf is used. **podman login** reads in the username and password from STDIN. 13 The username and password can also be set using the **username** and **password** flags. 14 The path of the authentication file can be specified by the user by setting the **authfile** 15 flag. The default path for reading and writing credentials is **${XDG\_RUNTIME\_DIR}/containers/auth.json**. 16 Podman uses existing credentials if the user does not pass in a username. 17 Podman first searches for the username and password in the **${XDG\_RUNTIME\_DIR}/containers/auth.json**, if they are not valid, 18 Podman then uses any existing credentials found in **$HOME/.docker/config.json**. 19 If those credentials are not present, Podman creates **${XDG\_RUNTIME\_DIR}/containers/auth.json** (if the file does not exist) and 20 then stores the username and password from STDIN as a base64 encoded string in it. 21 For more details about format and configurations of the auth.json file, see containers-auth.json(5) 22 23 **podman [GLOBAL OPTIONS]** 24 25 **podman login [GLOBAL OPTIONS]** 26 27 **podman login [OPTIONS] [REGISTRY] [GLOBAL OPTIONS]** 28 29 ## OPTIONS 30 31 @@option authfile 32 33 @@option cert-dir 34 35 #### **--compat-auth-file**=*path* 36 37 Instead of updating the default credentials file, update the one at *path*, and use a Docker-compatible format. 38 39 #### **--get-login** 40 41 Return the logged-in user for the registry. Return error if no login is found. 42 43 #### **--help**, **-h** 44 45 Print usage statement 46 47 #### **--password**, **-p**=*password* 48 49 Password for registry 50 51 #### **--password-stdin** 52 53 Take the password from stdin 54 55 #### **--secret**=*name* 56 57 Read the password for the registry from the podman secret `name`. 58 If --username is not specified --username=`name` is used. 59 60 @@option tls-verify 61 62 #### **--username**, **-u**=*username* 63 64 Username for registry 65 66 #### **--verbose**, **-v** 67 68 print detailed information about credential store 69 70 ## EXAMPLES 71 72 Add login credentials for specified registry to default authentication file; 73 note that unlike the `docker` default, the default credentials are under `$XDG_RUNTIME_DIR` 74 which is a subdirectory of `/run` (an emphemeral directory) and hence do not persist across reboot. 75 76 ``` 77 $ podman login quay.io 78 Username: umohnani 79 Password: 80 Login Succeeded! 81 ``` 82 83 To explicitly preserve credentials across reboot, you will need to specify 84 the default persistent path: 85 86 ``` 87 $ podman login --authfile ~/.config/containers/auth.json quay.io 88 Username: umohnani 89 Password: 90 Login Succeeded! 91 ``` 92 93 Add login credentials using specified username and password for local registry to default authentication file. 94 ``` 95 $ podman login -u testuser -p testpassword localhost:5000 96 Login Succeeded! 97 ``` 98 99 Add login credentials for alternate authfile path for the specified registry. 100 ``` 101 $ podman login --authfile authdir/myauths.json quay.io 102 Username: umohnani 103 Password: 104 Login Succeeded! 105 ``` 106 107 Add login credentials using a Podman secret for the password. 108 ``` 109 $ echo -n MySecret! | podman secret create secretname - 110 a0ad54df3c97cf89d5ca6193c 111 $ podman login --secret secretname -u testuser quay.io 112 Login Succeeded! 113 ``` 114 115 Add login credentials for user test with password test to localhost:5000 registry disabling tls verification requirement. 116 ``` 117 $ podman login --tls-verify=false -u test -p test localhost:5000 118 Login Succeeded! 119 ``` 120 121 Add login credentials for user foo with password bar to localhost:5000 registry using the certificate directory /etc/containers/certs.d. 122 ``` 123 $ podman login --cert-dir /etc/containers/certs.d/ -u foo -p bar localhost:5000 124 Login Succeeded! 125 ``` 126 127 Add login credentials for specified registries to default authentication file for given user with password information provided via stdin from a file on disk. 128 ``` 129 $ podman login -u testuser --password-stdin < testpassword.txt docker.io 130 Login Succeeded! 131 ``` 132 133 Add login credentials for specified registry to default authentication file for given user with password information provided via stdin from a pipe. 134 ``` 135 $ echo $testpassword | podman login -u testuser --password-stdin quay.io 136 Login Succeeded! 137 ``` 138 139 Add login credentials for specified registry to default authentication file in verbose mode. 140 ``` 141 $ podman login quay.io --verbose 142 Username: myusername 143 Password: 144 Used: /run/user/1000/containers/auth.json 145 Login Succeeded! 146 ``` 147 148 ## SEE ALSO 149 **[podman(1)](podman.1.md)**, **[podman-logout(1)](podman-logout.1.md)**, **[containers-auth.json(5)](https://github.com/containers/image/blob/main/docs/containers-auth.json.5.md)**, **[containers-certs.d(5)](https://github.com/containers/image/blob/main/docs/containers-certs.d.5.md)**, **[containers-registries.conf(5)](https://github.com/containers/image/blob/main/docs/containers-registries.conf.5.md)**, **[podman-secret(1)](podman-secret.1.md)**, **[podman-secret-create(1)](podman-secret-create.1.md)** 150 151 ## HISTORY 152 August 2017, Originally compiled by Urvashi Mohnani <umohnani@redhat.com>