Rancher 忘记用户名密码

  刚刚开始学习Rancher,前一分钟创建的用户名和密码下一秒就忘了。也是醉了····不过还好可以通过以下方式重新设置,摘自官网的文章http://docs.rancher.com/rancher/faqs/troubleshooting/#help-i-turned-on-access-control-and-can-no-longer-access-rancher-how-do-i-reset-rancher-to-disable-access-control

Authentication


HELP! I TURNED ON ACCESS CONTROL AND CAN NO LONGER ACCESS RANCHER. HOW DO I RESET RANCHER TO DISABLE ACCESS CONTROL?


If something goes wrong with your authentication (like your GitHub authentication getting corrupted), then you may be locked out of Rancher. To re-gain access to Rancher, you’ll need to turn off Access Control in the database. In order to do so, you’ll need access to the machine that is running Rancher Server.

$ docker exec -it <rancher_server_container_ID> mysql

NOTE:

The <rancher_server_container_ID> will be the container that has the Rancher database. If you upgraded and created a Rancher data container, you’ll need to use the ID of the Rancher data container instead of the Rancher server container.

Access the cattle database.

mysql> use cattle;

Review the setting table.

mysql> select * from setting;

Update the api.security.enabled to false. This change will turn off access control and anyone can access Rancher server with the UI/API.


mysql> update setting set value="false" where name="api.security.enabled";

Delete the client ID and secret key for GitHub.

mysql> update setting set value="" where name="api.auth.github.client.id";
mysql> update setting set value="" where name="api.auth.github.client.secret";

Confirm the changes have been made in the setting table.

mysql> select * from setting;

It may take ~1 minute before the authentication will be turned off in the UI, but you will be able to refresh the webpage and access Rancher with access control turned off.

操作完后等一分钟左右再次刷新Rancher server界面就可以了

转载于:https://my.oschina.net/liuhuan0927/blog/657235

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值