github.com/hanks177/podman/v4@v4.1.3-0.20220613032544-16d90015bc83/docs/source/markdown/podman-login.1.md (about) 1 % podman-login(1) 2 3 ## NAME 4 podman\-login - Login 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 will be 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 will use existing credentials if the user does not pass in a username. 17 Podman will first search for the username and password in the **${XDG\_RUNTIME\_DIR}/containers/auth.json**, if they are not valid, 18 Podman will then use any existing credentials found in **$HOME/.docker/config.json**. 19 If those credentials are not present, Podman will create **${XDG\_RUNTIME\_DIR}/containers/auth.json** (if the file does not exist) and 20 will then store 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, please refer to 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 #### **--authfile**=*path* 32 33 Path of the authentication file. Default is ${XDG\_RUNTIME\_DIR}/containers/auth.json. 34 35 Note: You can also override the default path of the authentication file by setting the REGISTRY\_AUTH\_FILE 36 environment variable. `export REGISTRY_AUTH_FILE=path` 37 38 #### **--cert-dir**=*path* 39 40 Use certificates at *path* (\*.crt, \*.cert, \*.key) to connect to the registry. (Default: /etc/containers/certs.d) 41 Please refer to containers-certs.d(5) for details. (This option is not available with the remote Podman client, including Mac and Windows (excluding WSL2) machines) 42 43 #### **--get-login** 44 45 Return the logged-in user for the registry. Return error if no login is found. 46 47 #### **--help**, **-h** 48 49 Print usage statement 50 51 #### **--password**, **-p**=*password* 52 53 Password for registry 54 55 #### **--password-stdin** 56 57 Take the password from stdin 58 59 #### **--tls-verify** 60 61 Require HTTPS and verify certificates when contacting registries (default: true). If explicitly set to true, 62 then TLS verification will be used. If set to false, then TLS verification will not be used. If not specified, 63 TLS verification will be used unless the target registry is listed as an insecure registry in registries.conf. 64 65 #### **--username**, **-u**=*username* 66 67 Username for registry 68 69 #### **--verbose**, **-v** 70 71 print detailed information about credential store 72 73 ## EXAMPLES 74 75 ``` 76 $ podman login docker.io 77 Username: umohnani 78 Password: 79 Login Succeeded! 80 ``` 81 82 ``` 83 $ podman login -u testuser -p testpassword localhost:5000 84 Login Succeeded! 85 ``` 86 87 ``` 88 $ podman login --authfile authdir/myauths.json docker.io 89 Username: umohnani 90 Password: 91 Login Succeeded! 92 ``` 93 94 ``` 95 $ podman login --tls-verify=false -u test -p test localhost:5000 96 Login Succeeded! 97 ``` 98 99 ``` 100 $ podman login --cert-dir /etc/containers/certs.d/ -u foo -p bar localhost:5000 101 Login Succeeded! 102 ``` 103 104 ``` 105 $ podman login -u testuser --password-stdin < testpassword.txt docker.io 106 Login Succeeded! 107 ``` 108 109 ``` 110 $ echo $testpassword | podman login -u testuser --password-stdin docker.io 111 Login Succeeded! 112 ``` 113 114 ``` 115 $ podman login quay.io --verbose 116 Username: myusername 117 Password: 118 Used: /run/user/1000/containers/auth.json 119 Login Succeeded! 120 ``` 121 122 ## SEE ALSO 123 **[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)** 124 125 ## HISTORY 126 August 2017, Originally compiled by Urvashi Mohnani <umohnani@redhat.com>