
// Module included in the following assemblies:
//
// * rosa_cli/rosa-get-started-cli.adoc

:_mod-docs-content-type: PROCEDURE
[id="rosa-login-sso-device-code_{context}"]
= Authenticate the {rosa-cli} with a single sign-on device code

[role="_abstract"]
If you are working with containers, remote hosts, and other environments without a web browser, you can use a Red{nbsp}Hat single sign-on device code for secure authentication. To do this, you must use a second device that has a web browser to approve the login.

.Prerequisites

* You have {rosa-cli-first} version 1.2.36 or later installed.
* You have access to a second device with a web browser.

.Procedure

* To log in to the {rosa-cli} with a Red{nbsp}Hat single sign-on device code, run the following command:
+
[source,terminal]
----
$ rosa login --use-device-code
----
+
Running this command redirects you to the Red{nbsp}Hat SSO login and provides a login code.
+
.Optional arguments inherited from parent commands
[cols="30,70"]
|===
|Option |Definition

|--help
|Shows help for this command.

|--debug
|Enables debug mode.

|===

.Verification

To switch accounts, log out from link:https://sso.redhat.com[https://sso.redhat.com] and run the `rosa logout` command in your terminal before attempting to log in again.
