欧卡2中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

需要三步,才能开始

只需两步,慢速开始

欧卡2入门方向盘选莱仕达V9莱仕达折叠便携游戏方向盘支架欢迎地图Mod入驻
查看: 6612|回复: 1
收起左侧

[Linux] 重置cloudstack web ui密码

[复制链接]
oppo 发表于 2014-9-15 12:21 | 显示全部楼层 |阅读模式
 楼主| oppo 发表于 2015-4-1 17:38 | 显示全部楼层
Objective
This article provides information on how to reset the CloudPlatform Administrator password.

If the password for the administrator account has been lost and cannot be reset using the user interface (there is no other administrator-level account to use), you can change it using API calls, or as a last resort by directly updating the database.
Instructions
Option 1 - API
Complete the following procedure to reset the password using API calls:
Note:  This procedure uses unauthenticated API interface and typically must be performed on the CloudPlatform server and the most preferred method.

Retrieve the ID of the user.

In CloudStack 2.2.x the default administrator account is ID 2. In CloudPlatform 3.0 the ID is a GUID.

curl 'http://localhost:8096/api?command=listUsers&username=admin' 2>/dev/null | xmllint --format - -o -

Using the ID from step 1, set a new password to the default of "password" for account ID 2 using the following command:
curl 'http://localhost:8096/api?command=updateUser&id=2&password=5f4dcc3b5aa765d61d8327deb882cf99' 2>/dev/null | xmllint --format - -o -

Option 2 - Database
Complete the following procedure to reset the password directly in the CloudPlatform database:

Note: This procedure must be done on a server having MySQL client installed and access to CloudPlatform database.
Backup the database.
For example, you can use the following command:

mysqldump -u root -ptherootpassword cloud > cloud_backup.sql

Go to the MySQL Command Line Interface:
mysql -u root -ptherootpassword cloud

If required, run a query to view the existing configuration for the administrator account:
SELECT id,username,password FROM user WHERE username = 'admin';

To change the password, set the "password" field to the MD5 hash of the new password. The following command sets it to the default of "password":
UPDATE user SET password = '5f4dcc3b5aa765d61d8327deb882cf99' WHERE username = 'admin';

Disclaimer
The above mentioned sample code is provided to you as is with no representations, warranties or conditions of any kind. You may use, modify and distribute it at your own risk. CITRIX DISCLAIMS ALL WARRANTIES WHATSOEVER, EXPRESS, IMPLIED, WRITTEN, ORAL OR STATUTORY, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NONINFRINGEMENT. Without limiting the generality of the foregoing, you acknowledge and agree that (a) the sample code may exhibit errors, design flaws or other problems, possibly resulting in loss of data or damage to property; (b) it may not be possible to make the sample code fully functional; and (c) Citrix may, without notice or liability to you, cease to make available the current version and/or any future versions of the sample code. In no event should the code be used to support of ultra-hazardous activities, including but not limited to life support or blasting activities. NEITHER CITRIX NOR ITS AFFILIATES OR AGENTS WILL BE LIABLE, UNDER BREACH OF CONTRACT OR ANY OTHER THEORY OF LIABILITY, FOR ANY DAMAGES WHATSOEVER ARISING FROM USE OF THE SAMPLE CODE, INCLUDING WITHOUT LIMITATION DIRECT, SPECIAL, INCIDENTAL, PUNITIVE, CONSEQUENTIAL OR OTHER DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Although the copyright in the code belongs to Citrix, any distribution of the code should include only your own standard copyright attribution, and not that of Citrix. You agree to indemnify and defend Citrix against any and all claims arising from your use, modification or distribution of the code.
Applicable Products
CloudPlatform 4.2.x




print
Was this helpful? Yes   No
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

联系我们|手机版|欧卡2中国 ( 湘ICP备11020288号-1 )

GMT+8, 2024-5-6 20:24 , Processed in 0.039877 second(s), 8 queries , Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表