前言
忘记密码了,怎么办?当然是重置啦。
如何重置?这就是本文要说的内容了。
由于我部署openstack时使用rdo,对手动安装不是很了解,所以才会产生了不会重置密码的问题。
如果我的方法有错,轻喷轻喷。
关于初始令牌(admin_token)
在手动安装时,一开始是没有admin用户的,也没有用户验证一说。
-
Q:没有管理用户,那要怎么管理呢?
-
A:使用admin_token进行管理
这个token可以在以下两个地方找到:
1.packstack生成的answer.conf:
# Token to use for the Identity service API.
CONFIG_KEYSTONE_ADMIN_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2.keystone配置文件(/etc/keystone/keystone.conf):
[DEFAULT]
#
# From keystone
#
# A "shared secret" that can be used to bootstrap Keystone. This "token" does
# not represent a user, and carries no explicit authorization. If set to
# `None`, the value is ignored and the `admin_token` log in mechanism is
# effectively disabled. To completely disable `admin_token` in production
# (highly recommended), remove AdminTokenAuthMiddleware from your paste
# application pipelines (for example, in keystone-paste.ini). (string value)
#admin_token = <None>
admin_token = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
使用token进行管理
使用这个token只能对用户进行管理,所以你也可以用来创建新的用户。(不确定,不过不能做用户管理以外的操作)
创建一个文件定义环境变量(比如这里是hsojo_rc):
export OS_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
export OS_URL=http://localhost:35357/v3
export OS_IDENTITY_API_VERSION=3
执行这个文件(加载变量)。
source hsojo_rc
加载之后即可对openstack的用户进行管理
[root@localhost ~]# openstack user list
+----------------------------------+------------+
| ID | Name |
+----------------------------------+------------+
| xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | admin |
| xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | ceilometer |
| xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | glance |
| xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | cinder |
| xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | gnocchi |
| xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | nova |
| xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | demo |
| xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | swift |
| xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | aodh |
| xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | neutron |
+----------------------------------+------------+
[root@localhost ~]#
最后执行命令重置密码:
openstack user set --password 123456 admin
问题解决。