Skip to content

Commit f83d87a

Browse files
Rajakavitha1andystevensnamewildmanonline
authored
[New] Manage Multiple Accounts with the Linode CLI (linode#5926)
* added the guide * Copy edits * Revamp of the guide to include more information on managing multiple accounts Co-authored-by: Andy Stevens <taylorstevens@gmail.com> Co-authored-by: Matt Wildman <matt@wildman.online>
1 parent 7d79f89 commit f83d87a

File tree

2 files changed

+68
-3
lines changed

2 files changed

+68
-3
lines changed

docs/products/tools/cli/guides/_index.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,17 @@ title: Guides
33
description: "Learn how to manage various Linode services using the Linode CLI."
44
tab_group_main:
55
weight: 30
6-
modified: 2022-11-30
6+
modified: 2022-12-06
77
---
88

99
## Basics
1010

11-
- [Get Started with the Linode CLI](/docs/products/tools/cli/get-started/)
11+
- [Get Started with the Linode CLI](/docs/products/tools/cli/get-started/): Learn the basics of using the Linode CLI, including running a command and understanding the output.
12+
13+
- [Install and Configure the Linode CLI](/docs/products/tools/cli/guides/install/): Instructions on installing and configuring the Linode CLI on your system.
14+
15+
- [Manage Multiple Users and Accounts with the Linode CLI](/docs/products/tools/cli/guides/manage-multiple-accounts/): Execute commands from different users or accounts.
1216

13-
- [Install and Configure the Linode CLI](/docs/products/tools/cli/guides/install/)
1417

1518
## Using the Linode CLI
1619

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
author:
3+
name: Linode
4+
email: docs@linode.com
5+
title: "Manage Multiple Accounts with the Linode CLI"
6+
description: "How to use the Linode CLI to manage multiple Linode accounts."
7+
published: 2022-12-06
8+
---
9+
10+
The Linode CLI can be configured to run commands from multiple users on separate Linode Accounts. This allows you to control multiple accounts, all through the same system, using the Linode CLI. Once multiple users are configured, you can execute commands as a particular user or set a specific user as the default.
11+
12+
## Configure an Additional User
13+
14+
To manage another Linode Account, you must configure the Linode CLI with a user on that account. This is accomplished by re-running the Linode CLI configuration utility (see [Configure the Linode CLI](/docs/products/tools/cli/guides/install/#configure-the-linode-cli)).
15+
16+
```command
17+
linode-cli configure
18+
```
19+
20+
## View Users
21+
22+
To see which users have already been configured on the Linode CLI, run the following command:
23+
24+
```command
25+
linode-cli show-users
26+
```
27+
28+
This outputs a list containing the usernames of each user. An asterisks (`*`) marks the user that is current active (the default user).
29+
30+
```output
31+
Configured Users:
32+
* example-user
33+
another-user
34+
```
35+
36+
## Change the Default User
37+
38+
The default user is used when running Linode CLI commands. Run the following command to change the default user, replacing *[username]* with the name of the user you wish to use.
39+
40+
```command
41+
linode-cli set-user [username]
42+
```
43+
44+
## Run a Command as a Different User
45+
46+
You can run a Linode CLI command as a specific user *without* needing to change the default user. This is helpful if you need to run a one-off command on a different account. In the command below, replace *[username]* with the name of the user you wish to use.
47+
48+
```command
49+
linode-cli set-user --as-user [username]
50+
```
51+
52+
## Remove a User from the Linode CLI
53+
54+
If you no longer wish to manage a particular user or account from the Linode CLI, you can remove that user. In the command below, replace *[username]* with the name of the user you wish to remove.
55+
56+
{{< note >}}
57+
This does not delete the user on the Linode Platform. It only removes the user from the Linode CLI so you can no longer execute commands as that user.
58+
{{< /note >}}
59+
60+
```command
61+
linode-cli remove-user [username]
62+
```

0 commit comments

Comments
 (0)