Adding or Removing a User from a Group
You can add a user to a group and remove it at any time. A user can belong to several groups at the same time, and there is no limit to the number of users in a group.
You can then add an inline policy or attach a managed policy to the group, which is applied to all its users.
Adding or Removing a User Using Cockpit v2
Adding a User to a Group
You can also add a user when creating a group. For more information, see Creating a Group. |
-
In the EIM Users dashboard, check the box of the user you want to add to a group.
The user is selected. -
Click Update EIM Groups.
The UPDATE EIM GROUPS dialog box appears. -
In the Groups field, select one or more groups you want to add the user to.
-
Click Update.
The user is added to the group.
Removing a User from a Group
-
In the EIM Users dashboard, check the box of the user you want to remove from a group.
The user is selected. -
Click Update EIM Groups.
The UPDATE EIM GROUPS dialog box appears. -
In the Groups field, click next to the name of the group you want to remove the user from.
-
Click Update.
The user is removed from the group.
Adding or Removing a User Using OSC CLI
Adding a User to a Group
The AddUserToUserGroup command adds a user to a specified group.
$ osc-cli api AddUserToUserGroup --profile "default" \
--UserGroupName "example-usergroup" \
--UserGroupPath "/example/" \
--UserName "example-user" \
--UserPath "/example/"
This command contains the following attributes that you need to specify:
-
DryRun
: (optional) If true, checks whether you have the required permissions to perform the action. -
UserGroupName
: The name of the group you want to add a user to. -
UserGroupPath
: (optional) The path to the group. If not specified, it is set to a slash (/
). -
UserName
: The name of the user you want to add to the group. -
UserPath
: (optional) The path to the user. If not specified, it is set to a slash (/
).
The AddUserToUserGroup command returns the following elements:
-
ResponseContext
: Information about the context of the response.-
RequestId
: The ID of the request.
-
{
"ResponseContext": {
"RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
}
}
Removing a User from a Group
The RemoveUserFromUserGroup command removes a specified user from a specified group.
$ osc-cli api RemoveUserFromUserGroup --profile "default" \
--UserGroupName "example-usergroup" \
--UserGroupPath "/example/" \
--UserName "example-user" \
--UserPath "/example/"
This command contains the following attributes that you need to specify:
-
DryRun
: (optional) If true, checks whether you have the required permissions to perform the action. -
UserGroupName
: The name of the group you want to remove the user from. -
UserGroupPath
: (optional) The path to the group. If not specified, it is set to a slash (/
). -
UserName
: The name of the user you want to remove from the group. -
UserPath
: (optional) The path to the user (by default,/
).
The RemoveUserFromUserGroup command returns the following elements:
-
ResponseContext
: Information about the context of the response.-
RequestId
: The ID of the request.
-
{
"ResponseContext": {
"RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
}
}
Adding or Removing a User Using oapi-cli
Adding a User to a Group
The AddUserToUserGroup command adds a user to a specified group.
$ oapi-cli --profile "default" AddUserToUserGroup \
--UserGroupName "example-usergroup" \
--UserGroupPath "/example/" \
--UserName "example-user" \
--UserPath "/example/"
This command contains the following attributes that you need to specify:
-
DryRun
: (optional) If true, checks whether you have the required permissions to perform the action. -
UserGroupName
: The name of the group you want to add a user to. -
UserGroupPath
: (optional) The path to the group. If not specified, it is set to a slash (/
). -
UserName
: The name of the user you want to add to the group. -
UserPath
: (optional) The path to the user. If not specified, it is set to a slash (/
).
The AddUserToUserGroup command returns the following elements:
-
ResponseContext
: Information about the context of the response.-
RequestId
: The ID of the request.
-
{
"ResponseContext": {
"RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
}
}
Removing a User from a Group
The RemoveUserFromUserGroup command removes a specified user from a specified group.
$ oapi-cli --profile "default" RemoveUserFromUserGroup \
--UserGroupName "example-usergroup" \
--UserGroupPath "/example/" \
--UserName "example-user" \
--UserPath "/example/"
This command contains the following attributes that you need to specify:
-
DryRun
: (optional) If true, checks whether you have the required permissions to perform the action. -
UserGroupName
: The name of the group you want to remove the user from. -
UserGroupPath
: (optional) The path to the group. If not specified, it is set to a slash (/
). -
UserName
: The name of the user you want to remove from the group. -
UserPath
: (optional) The path to the user (by default,/
).
The RemoveUserFromUserGroup command returns the following elements:
-
ResponseContext
: Information about the context of the response.-
RequestId
: The ID of the request.
-
{
"ResponseContext": {
"RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
}
}
Adding or Removing a User Using AWS CLI
Before you begin: Install and configure AWS CLI. For more information, see Installing and Configuring AWS CLI. |
Adding a User to a Group
To add a user to a group, use the add-user-to-group command following this syntax:
$ aws iam add-user-to-group \
--profile YOUR_PROFILE \
--group-name GROUP_NAME \
--user-name USER_NAME \
--endpoint https://eim.eu-west-2.outscale.com
This command contains the following attributes that you need to specify:
-
(optional)
profile
: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI. -
group-name
: The name of the group you want to add a user to. -
user-name
: The name of the user you want to add to the group. -
endpoint
: The endpoint corresponding to the Region you want to send the request to. For more information, see Installing and Configuring AWS CLI.
The specified user is added to the specified group.
Removing a User from a Group
To remove a user from a group, use the remove-user-from-group command following this syntax:
$ aws iam remove-user-from-group \
--profile YOUR_PROFILE \
--group-name GROUP_NAME \
--user-name USER_NAME \
--endpoint https://eim.eu-west-2.outscale.com
This command contains the following attributes that you need to specify:
-
(optional)
profile
: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI. -
group-name
: The name of the group you want to remove a user from. -
user-name
: The name of the user you want to remove from the group. -
endpoint
: The endpoint corresponding to the Region you want to send the request to. For more information, see Installing and Configuring AWS CLI.
The user is removed from the specified group.
Related Pages
Corresponding API Methods
AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.