[OpenStack] 终端登陆 用户切换
来源:互联网 发布:业绩考核软件 编辑:程序博客网 时间:2024/05/16 05:20
用Crowbar安装OpenStack,operating systeme: SLES 11SP3.
由于之前安装cisco插件出现的BUG (bug 问题以后再写),在终端登陆时,有的时候需要用不同的身份(role)来进行测试.
方法一 还没有验证
1. 用所需用户名登陆到openstack 的dashboard, 在相应project下面,点击进入access&security
2. 在API Access的标签栏里面,点击 Download OpenStack RC File。文件名字的格式为 PROJECT-openrc.sh, 其中PROJECT是下载文件所属的项目名字
3. 复制该文件到需要运行openstack命令的电脑上
4. source demo-openrc.sh
方法二 验证成功
个人喜欢这个方法,简单粗暴
直接建立一个文件,叫什么名字随便,方便自己记住就可以了。名字.sh
export OS_AUTH_URL=https:
//identityHost
:portNumber
/v2
.0
export OS_TENANT_ID=demo
export OS_TENANT_NAME="demo"
export OS_USERNAME="demo"
export OS_PASSWORD="demo"
保存,直接运行文件就好了。
也可以要求每次操作都输入密码:
export OS_AUTH_URL=https:
//identityHost
:portNumber
/v2
.0
export OS_TENANT_ID=demo
export OS_TENANT_NAME="demo"
export OS_USERNAME="demo"echo "Please enter your OpenStack Password: "
read -sr OS_PASSWORD_INPUT
export OS_PASSWORD=$OS_PASSWORD_INPUT
$ keystone --os-password PASSWORD
service-list
该命令用来修改替代文件中的密码 (即时一次性的)附上官方文档
Download and source the OpenStack RC file
Log in to the OpenStack dashboard, choose the project for which you want to download the OpenStack RC file, and click
.On the API Access tab, click
and save the file. The filename will be of the form
wherePROJECT
-openrc.shPROJECT
is the name of the project for which you downloaded the file.Copy the
file to the computer from which you want to run OpenStack commands.PROJECT
-openrc.shFor example, copy the file to the computer from which you want to upload an image with aglance client command.
On any shell from which you want to run OpenStack commands, source the
file for the respective project.PROJECT
-openrc.shIn the following example, the
demo-openrc.sh
file is sourced for the demo project:$ source demo-openrc.sh
When you are prompted for an OpenStack password, enter the password for the user who downloaded the
file.PROJECT
-openrc.sh
Create and source the OpenStack RC file
Alternatively, you can create the
file from scratch, if for some reason you cannot download the file from the dashboard.PROJECT
-openrc.sh
In a text editor, create a file named
file and add the following authentication information:PROJECT
-openrc.sh1234567export
OS_USERNAME=username
export
OS_PASSWORD=password
export
OS_TENANT_NAME=projectName
export
OS_AUTH_URL=https:
//identityHost
:portNumber
/v2
.0
# The following lines can be omitted
export
OS_TENANT_ID=tenantIDString
export
OS_REGION_NAME=regionName
The following example shows the information for a project called
admin
, where the OS username is alsoadmin
, and the identity host is located atcontroller
.On any shell from which you want to run OpenStack commands, source the
file for the respective project. In this example, you source thePROJECT
-openrc.shadmin-openrc.sh
file for theadmin
project:$ source admin-openrc.sh
You are not prompted for the password with this method. The password lives in clear text format in the
file. Restrict the permissions on this file to avoid security problems. You can also remove thePROJECT
-openrc.shOS_PASSWORD
variable from the file, and use the --password
parameter with OpenStack client commands instead.
Override environment variable values
When you run OpenStack client commands, you can override some environment variable settings by using the options that are listed at the end of thehelp output of the various client commands. For example, you can override theOS_PASSWORD
setting in the
file by specifying a password on akeystone command, as follows:PROJECT
-openrc.sh
$ keystone --os-password PASSWORD
service-list
Where PASSWORD
is your password.
- [OpenStack] 终端登陆 用户切换
- mac终端切换用户
- 切换用户登陆
- Mac终端切换root用户
- mysql如何切换用户登陆
- TortoiseSVN清除当前登陆用户 切换用户
- Ubuntu 下终端切换到超级用户
- ubuntu 11.04终端无法切换root用户
- ubuntu 11.04终端无法切换root用户
- Linux用户登陆与控制台切换
- 免秘钥SSH登陆,切记切换用户
- 防止网管用Query User察看终端登陆用户
- 限制根用户可以登陆的终端/etc/securetty
- ubuntu13.04终端添加用户与登陆root
- 如何切换到root用户 --- 终端命令行方式
- linux里终端切换为root用户的方式
- Mac OS X 10.8.2终端切换root用户
- OSX:准许管理员屏保登陆窗口切换用户
- :PhoneGap 3.5.0正式发布
- 上班族必知的补脑食物
- 找出占用端口的进程pid,关闭它
- fgets与feof 判断文件结尾
- 关于iframe中的按钮全屏切换
- [OpenStack] 终端登陆 用户切换
- Android UI设计之<五>自定义DrawView组件,实现数字签名效果
- 九度 题目1172:哈夫曼树
- Java NIO和IO的主要区别
- 时间成本的选择
- sack
- BMP文件结构
- TotoiseSVN的基本使用方法
- 消除模板变量中的小u