virtualbox+vagrant学习-2(command cli)-2-vagrant cloud命令--有问题
Cloud
https://www.vagrantup.com/docs/cli/cloud.html
命令: vagrant cloud
这是用来管理与vagrant相关的任何东西的命令。
该命令的主要功能是通过子命令公开的:
1)Cloud Auth
cloud auth命令用于处理与vagrant云授权相关的所有事情。
1》Cloud Auth Login
格式:
vagrant cloud auth login [options]
登录命令用于对HashiCorp的vagrant云服务器进行身份验证。只有在访问受保护的boxes时才需要登录。
使用Vagrant不需要登录。绝大多数vagrant使用者不需要登录。只有在使用某些特性,如使用受保护的boxes时需要登录。
userdeMBP:~ user$ vagrant cloud auth login -h
Usage: vagrant cloud auth login [options] Options: -c, --check Checks if currently logged in 查看目前是否已经登录
-d, --description DESCRIPTION Set description for the Vagrant Cloud token 设置vagrant云令牌的描述,将会改变用户此时的token值
-k, --logout Logout from Vagrant Cloud 从vagrant云退出
-t, --token TOKEN Set the Vagrant Cloud token 设置vagrant云令牌,将其存储在本地磁盘上
-u, --username USERNAME_OR_EMAIL Vagrant Cloud username or email address vagrant云用户名或邮箱地址
-h, --help Print this help 打印帮助信息
例子:
1>使用用户名和密码安全认证到vagrant云:
userdeMBP:~ user$ vagrant cloud auth login
In a moment we will ask for your username and password to HashiCorp's Vagrant Cloud. After authenticating, we will store an access token locally on disk. Your login details will be transmitted over a secure connection, and
are never stored on disk locally. If you do not have an Vagrant Cloud account, sign up at
https://www.vagrantcloud.com Vagrant Cloud username or email:
因为我还没有注册,所以应该先到https://www.vagrantcloud.com 进行注册
成功创建了一个账户后再使用login:
userdeMBP:~ user$ vagrant cloud auth login
In a moment we will ask for your username and password to HashiCorp's
Vagrant Cloud. After authenticating, we will store an access token locally on
disk. Your login details will be transmitted over a secure connection, and
are never stored on disk locally. If you do not have an Vagrant Cloud account, sign up at
https://www.vagrantcloud.com Vagrant Cloud username or email: Garcia-user
Password (will be hidden):
Token description (Defaults to "Vagrant login from userdeMacBook-Pro.local"):
You are now logged in.
2>检查当前用户是否经过身份验证
userdeMBP:~ user$ vagrant cloud auth login -c
You are already logged in.
3>使用令牌对vagrant云进行安全身份验证:
因为在上面的login过程中,在Token description 中没有输入内容,所以其默认为Vagrant login from userdeMacBook-Pro.local
userdeMBP:~ user$ vagrant cloud auth login -t Vagrant login from userdeMacBook-Pro.local
The token was successfully saved.
Invalid token. Please try again.
然后我又重新login了一遍,将Token description 值内容设置为firsttime-login
1.下面使用的-t标签的作用是将firsttime-login token值存储在你本地的磁盘中
userdeMBP:~ user$ vagrant cloud auth login -t firsttime-login
The token was successfully saved.
Invalid token. Please try again.
2.使用-d标签,通过token的描述来生成一个token,其实过程和login是一样的:
userdeMBP:~ user$ vagrant cloud auth login -d firsttime-login
In a moment we will ask for your username and password to HashiCorp's Vagrant Cloud. After authenticating, we will store an access token locally on disk. Your login details will be transmitted over a secure connection, and
are never stored on disk locally. If you do not have an Vagrant Cloud account, sign up at
https://www.vagrantcloud.com Vagrant Cloud username or email: Garcia-user
Password (will be hidden):
Token description: firsttime-login
You are now logged in.
然后我们在网站上可以看见:
有三个token信息,是上面的两个login和一个-d生成的
如果这个时候我运行:
userdeMBP:~ user$ vagrant cloud auth login -t secondtime-login
The token was successfully saved.
Invalid token. Please try again.
发现上面图示的页面不会有什么变化,所以-t标签是不会对用户token造成影响的,仅仅只是存储到了本地磁盘
2》Cloud Auth Logout
格式:
vagrant cloud auth logout [options]
当你已经登录时用来退出。如果你已经退出了,这个命令将不会做什么。如果你已经退出,运行这个命令是不会出现什么错误的
userdeMBP:~ user$ vagrant cloud auth logout -h
Usage: vagrant cloud auth logout [options] Log out of Vagrant Cloud Options: -u, --username USERNAME_OR_EMAIL Vagrant Cloud username or email address Vagrant云的用户名或邮箱地址
-h, --help Print this help 打印帮助信息
例子:
userdeMBP:~ user$ vagrant cloud auth logout
In a moment we will ask for your username and password to HashiCorp's
Vagrant Cloud. After authenticating, we will store an access token locally on
disk. Your login details will be transmitted over a secure connection, and
are never stored on disk locally. If you do not have an Vagrant Cloud account, sign up at
https://www.vagrantcloud.com Vagrant Cloud username or email: Garcia-user
Password (will be hidden):
Token description (Defaults to "Vagrant login from userdeMacBook-Pro.local"): firsttime-logout
You are now logged in.
You are logged out.
查看login状态:
userdeMBP:~ user$ vagrant cloud auth login -c
You are not currently logged in. Please run `vagrant login` and provide your login information to authenticate.
果然成功退出了
3》Cloud Auth Whoami
格式:
vagrant cloud auth whoami [options] [token]
这个命令将验证你的vagrant云令牌,并打印它所属的用户。如果传入一个令牌值,它将尝试验证它,而不是将其存储在磁盘上。
userdeMBP:~ user$ vagrant cloud auth whoami -h
Usage: vagrant cloud auth whoami [options] [token] Display currently logged in user Options: -u, --username USERNAME_OR_EMAIL Vagrant Cloud username or email address Vagrant云的用户名或邮箱地址
-h, --help Print this help 打印帮助信息
例子:
userdeMBP:~ user$ vagrant cloud auth logout
You are logged out.
userdeMBP:~ user$ vagrant cloud auth whoami //因为之前退出过,所以调用whoami前要先登录才行
In a moment we will ask for your username and password to HashiCorp's
Vagrant Cloud. After authenticating, we will store an access token locally on
disk. Your login details will be transmitted over a secure connection, and
are never stored on disk locally. If you do not have an Vagrant Cloud account, sign up at
https://www.vagrantcloud.com Vagrant Cloud username or email: Garcia-user
Password (will be hidden):
Token description (Defaults to "Vagrant login from userdeMBP.lan"): secondtime-login //重新设置这次新登录的新token描述
You are now logged in.
Currently logged in as Garcia-user userdeMBP:~ user$ vagrant cloud auth whoami //但是直接调用whoami就能够得到你登录的信息
Currently logged in as Garcia-user
但是如果想要将token添加进去验证时,就会报错:?????????
没能解决,有解决该问题的小伙伴请告知,谢谢
userdeMBP:~ user$ vagrant cloud auth whoami secondtime-login
Failed to read organization
Unauthorized - {"message"=>"Bad credentials"} userdeMBP:~ user$ vagrant cloud auth whoami -u Garcia-user //如果仅仅指明用户名,又不会出错
Currently logged in as Garcia-user userdeMBP:~ user$ vagrant cloud auth whoami -u Garcia-user secondtime-login
Failed to read organization
Unauthorized - {"message"=>"Bad credentials"}
2)Cloud Box
命令: vagrant cloud box
1》Cloud Box Create
格式:
vagrant cloud box create [options] organization/box-name
box create命令用于在Vagrant云上创建一个新的box条目
userdeMacBook-Pro:~ user$ vagrant cloud box create -h
Usage: vagrant cloud box create [options] organization/box-name Creates an empty box entry on Vagrant Cloud Options: -d, --description DESCRIPTION Full description of the box 该box的详细描述信息
-u, --username USERNAME_OR_EMAIL Vagrant Cloud username or email address vagrant云的用户名或邮箱地址
-s DESCRIPTION, Short description of the box 该box的简短描述信息
--short-description
-p, --private Makes box private 私有化box,仅自己可见
-h, --help Print this help 打印帮助信息
2》Cloud Box Delete
格式:
vagrant cloud box delete [options] organization/box-name
删除vagrant云上的某box条目
userdeMacBook-Pro:~ user$ vagrant cloud box delete -h
Usage: vagrant cloud box delete [options] organization/box-name Deletes box entry on Vagrant Cloud 删除vagrant云上的某box条目 Options: -u, --username USERNAME_OR_EMAIL Vagrant Cloud username or email addressvagrant云的用户名或邮箱地址
-h, --help Print this help 打印帮助信息
3》Cloud Box Show
格式:
vagrant cloud box show [options] organization/box-name
显示vagrant云上某box的属性
userdeMacBook-Pro:~ user$ vagrant cloud box show -h
Usage: vagrant cloud box show [options] organization/box-name Displays a boxes attributes on Vagrant Cloud 显示vagrant云上某box的属性 Options: -u, --username USERNAME_OR_EMAIL Vagrant Cloud username or email address vagrant云的用户名或邮箱地址
--versions VERSION Display box information for a specific version 显示指定版本的box的信息
-h, --help Print this help 打印帮助信息
4》Cloud Box Update
格式:
vagrant cloud box update [options] organization/box-name
更新vagrant云上的box条目
userdeMacBook-Pro:~ user$ vagrant cloud box update -h
Usage: vagrant cloud box update [options] organization/box-name Updates a box entry on Vagrant Cloud 更新vagrant云上的box条目 Options: -d, --description DESCRIPTION Full description of the box 该box的详细描述信息
-u, --username The username of the organization that will own the box 拥有该box的组织的用户名
-s DESCRIPTION, Short description of the box 该box的简短描述信息
--short-description
-p, --private Makes box private 私有化box,仅自己可见
-h, --help Print this help 打印帮助信息
3)Cloud Provider
命令: vagrant cloud provider
云provider
命令用于管理vagrant云上所有provider
实体的生命周期操作。
1》Cloud Provider Create
格式:
vagrant cloud provider create [options] organization/box-name provider-name version [url]
在vagrant云上创建一个provider条目
userdeMacBook-Pro:~ user$ vagrant cloud provider create -h
Usage: vagrant cloud provider create [options] organization/box-name provider-name version [url] Creates a provider entry on Vagrant Cloud 在vagrant云上创建一个provider条目 Options: -u, --username USERNAME_OR_EMAIL Vagrant Cloud username or email address vagrant云的用户名或邮箱地址
-h, --help Print this help 打印帮助信息
[url]参数应该是一个远程url,vagrant云可以使用它来下载provider。如果没有指定url,以后可以使用url更新提供provider条目,或者使用upload命令上传vagrant box文件。
2》Cloud Provider Delete
格式:
vagrant cloud provider delete [options] organization/box-name provider-name version
删除vagrant云上的某provider条目
userdeMacBook-Pro:~ user$ vagrant cloud provider delete -h
Usage: vagrant cloud provider delete [options] organization/box-name provider-name version Deletes a provider entry on Vagrant Cloud 删除vagrant云上的某provider条目 Options: -u, --username USERNAME_OR_EMAIL Vagrant Cloud username or email address vagrant云的用户名或邮箱地址
-h, --help Print this help 打印帮助信息
3》Cloud Provider Update
格式:
vagrant cloud provider update [options] organization/box-name provider-name version url
更新vagrant云上的某个provider条目
userdeMacBook-Pro:~ user$ vagrant cloud provider update -h
Usage: vagrant cloud provider update [options] organization/box-name provider-name version url Updates a provider entry on Vagrant Cloud 更新vagrant云上的某个provider条目 Options: -u, --username USERNAME_OR_EMAIL Vagrant Cloud username or email address vagrant云的用户名或邮箱地址
-h, --help Print this help 打印帮助信息
4》Cloud Provider Upload
格式:
vagrant cloud provider upload [options] organization/box-name provider-name version box-file
上传指定provider的box文件到vagrant云中
userdeMacBook-Pro:~ user$ vagrant cloud provider upload -h
Usage: vagrant cloud provider upload [options] organization/box-name provider-name version box-file Uploads a box file to Vagrant Cloud for a specific provider 上传指定provider的box文件到vagrant云中 Options: -u, --username USERNAME_OR_EMAIL Vagrant Cloud username or email address vagrant云的用户名或邮箱地址
-h, --help Print this help 打印帮助信息
provider上传命令将向vagrant云上传指定版本和provider的vagrant box文件
4)Cloud Publish
格式:
vagrant cloud publish ORGANIZATION/BOX-NAME VERSION PROVIDER-NAME [PROVIDER-FILE]
在vagrant云上创建和公布一个新的vagrant box
userdeMacBook-Pro:~ user$ vagrant cloud publish -h
Usage: vagrant cloud publish [options] organization/box-name version provider-name [provider-file] Create and release a new Vagrant Box on Vagrant Cloud 在vagrant云上创建和公布一个新的vagrant box Options: --box-version VERSION Version of box to create 创建的box的版本
--url URL Remote URL to download this provider 下载这个provider的远程URL
-d, --description DESCRIPTION Full description of box 该box的详细描述信息
--version-description DESCRIPTION Description of the version to create 该创建版本的描述
-f, --force Disables confirmation to create or update box 取消创建和更新box时的确认,即强制执行
-p, --private Makes box private 私有化box,仅自己可见
-r, --release Releases box 公布box
-s DESCRIPTION, Short description of the box 该box的简短描述信息
--short-description
-u, --username USERNAME_OR_EMAIL Vagrant Cloud username or email address vagrant云的用户名或邮箱地址
-h, --help Print this help 打印帮助信息
5)Cloud Search
格式:
vagrant cloud search [options] query
通过指定的user/organization名字来在vagrant云上搜索boxes
userdeMacBook-Pro:~ user$ vagrant cloud search -h
Usage: vagrant cloud search [options] query Search for boxes managed by a specific user/organization on Vagrant Cloud。通过指定的user/organization名字来在vagrant云上搜索boxes Options: -j, --json Formats results in JSON 将结果格式化成JSON格式
--page PAGE The page to display Default: 默认显示一页的内容
-s, --short Shows a simple list of box names 只显示box名字的简单列表
-o, --order ORDER Order to display results ('desc' or 'asc') Default: 'desc' 显示结果的顺序(逆向或正向),默认为逆向
-l, --limit LIMIT Max number of search results Default: 搜索结果的最大数量,默认为25
-p, --provider PROVIDER Filter search results to a single provider. Defaults to all. 使用provider来过滤搜索结果。默认是得到所有provider类型
--sort-by SORT Field to sort results on (created, downloads, updated) Default: downloads
指定用于对结果进行排序的字断(created, downloads, updated),默认使用的是downloads(即下载数量)
-u, --username USERNAME_OR_EMAIL Vagrant Cloud username or email address vagrant云的用户名或邮箱地址
-h, --help Print this help 打印帮助信息
例子:
6)Cloud Version
命令: vagrant cloud version
云version
命令用于管理vagrant云上的一个box中的所有版本实体的生命周期操作。
1》Cloud Version Create
格式:
vagrant cloud version create [options] organization/box-name version
在vagrant云上创建版本条目
userdeMacBook-Pro:~ user$ vagrant cloud version create -h
Usage: vagrant cloud version create [options] organization/box-name version Creates a version entry on Vagrant Cloud 在vagrant云上创建版本条目 Options: -d, --description DESCRIPTION A description for this version 对该版本的详细描述
-u, --username USERNAME_OR_EMAIL Vagrant Cloud username or email address vagrant云的用户名或邮箱地址
-h, --help Print this help 打印帮助信息
2》Cloud Version Delete
格式:
vagrant cloud version delete [options] organization/box-name version
从vagrant云中删除一个版本条目
userdeMacBook-Pro:~ user$ vagrant cloud version delete -h
Usage: vagrant cloud version delete [options] organization/box-name version Deletes a version entry on Vagrant Cloud 从vagrant云中删除一个版本条目 Options: -u, --username USERNAME_OR_EMAIL Vagrant Cloud username or email address vagrant云的用户名或邮箱地址
-h, --help Print this help 打印帮助信息
3》Cloud Version Release
格式:
vagrant cloud version release [options] organization/box-name version
在vagrant云上发布版本条目
userdeMacBook-Pro:~ user$ vagrant cloud version release -h
Usage: vagrant cloud version release [options] organization/box-name version Releases a version entry on Vagrant Cloud 在vagrant云上发布版本条目 Options: -u, --username USERNAME_OR_EMAIL Vagrant Cloud username or email address vagrant云的用户名或邮箱地址
-h, --help Print this help 打印帮助信息
4》Cloud Version Revoke
格式:
vagrant cloud version revoke [options] organization/box-name version
从vagrant云上撤销一个版本条目
userdeMacBook-Pro:~ user$ vagrant cloud version revoke -h
Usage: vagrant cloud version revoke [options] organization/box-name version Revokes a version entry on Vagrant Cloud 从vagrant云上撤销一个版本条目 Options: -u, --username USERNAME_OR_EMAIL Vagrant Cloud username or email address vagrant云的用户名或邮箱地址
-h, --help Print this help 打印帮助信息
5》Cloud Version Update
格式:
vagrant cloud version update [options] organization/box-name version
更新在vagrant云上的版本条目
userdeMacBook-Pro:~ user$ vagrant cloud version update -h
Usage: vagrant cloud version update [options] organization/box-name version Updates a version entry on Vagrant Cloud 更新在vagrant云上的版本条目 Options: -d, --description DESCRIPTION A description for this version 对该版本的详细描述
-u, --username USERNAME_OR_EMAIL Vagrant Cloud username or email address vagrant云的用户名或邮箱地址
-h, --help Print this help 打印帮助信息
virtualbox+vagrant学习-2(command cli)-2-vagrant cloud命令--有问题的更多相关文章
- virtualbox+vagrant学习-2(command cli)-17-vagrant ssh命令
SSH 格式: vagrant ssh [options] [name|id] [-- extra ssh args] 这将SSH导入正在运行的vagrant机器,并允许你访问机器的shell. us ...
- virtualbox+vagrant学习-2(command cli)-26-vagrant share命令
Share share命令初始化了一个vagrant share会话,允许你与世界上任何一个人共享vagrant环境,允许在几乎任何网络环境中直接在vagrant环境中进行协作. 你可以在本博客的vi ...
- virtualbox+vagrant学习-2(command cli)-1-vagrant box命令
vagrant box 这是用于管理(添加.删除等)boxes的命令. box 是一个打包好的操作系统,是一个后缀名为 .box 的文件,其实是一个压缩包,里面包含了 Vagrant 的配置信息和 V ...
- virtualbox+vagrant学习-2(command cli)-7-vagrant login命令
Login ⚠️该命令已经弃用了,别名为vagrant cloud auth login.看本博客的 格式: vagrant cloud auth login [options] 登录命令用于使用Ha ...
- virtualbox+vagrant学习-2(command cli)-11-vagrant PowerShell命令
PowerShell 格式: vagrant powershell [-- extra powershell args] 这将在主机上打开PowerShell提示符,进入正在运行的vagrant机器. ...
- virtualbox+vagrant学习-2(command cli)-4-vagrant global-status命令
Global Status 格式: vagrant global-status 这个命令将告诉你当前登录的用户系统上所有活跃的vagrant环境的状态. userdeMacBook-Pro:~ use ...
- virtualbox+vagrant学习-2(command cli)-21-vagrant up命令
Up 格式: vagrant up [options] [name|id] 这个命令根据你的Vagrantfile文件创建和配置客户机. 这是“vagrant”中最重要的一个命令,因为它是创建任何va ...
- virtualbox+vagrant学习-2(command cli)-23-vagrant version命令
Version 格式: vagrant version options只有 -h, --help 该命令将告诉你已安装的vagrant版本以及当前可用的vagrant最新版本. userdeMacBo ...
- virtualbox+vagrant学习-2(command cli)-24-Aliases别名
Aliases 别名的部分灵感来自Git自身的别名功能,它允许你创建自己的定制vagrant命令,从而使你的vagrant体验更简单.更容易.更熟悉. 别名可以在VAGRANT_HOME/ alias ...
随机推荐
- ssm项目快速搭建(配置)
核心jar包 <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncod ...
- AutoFac使用方法总结一:注册
AutoFac是.net平台下的IOC容器产品,它可以管理类之间的复杂的依赖关系.在使用方面主要是register和resolve两类操作. 这篇文章用单元测试的形式列举了AutoFac的常用使用方法 ...
- sql SUM求和
- bzoj P3309 DZY Loves Math——solution
对于正整数n,定义f(n)为n所含质因子的最大幂指数.例如f(1960)=f(2^3 * 5^1 * 7^2)=3, f(10007)=1, f(1)=0.给定正整数a,b,求: $$\sum_{i= ...
- 格式化字符串漏洞利用实战之 0ctf-easyprintf
前言 这是 0ctf 的一道比较简单的格式化串的题目. 正文 逻辑非常简单 do_read 可以打印内存地址的数据,可用来 泄露 got. leave 格式化字符串漏洞. printf(s) 直接调用 ...
- owin Claims-based认证登录实现
public override async Task GrantResourceOwnerCredentials(OAuthGrantResourceOwnerCredentialsContext c ...
- NLS_LANG引起的SQLPLUS乱码和length长度不正确.
创建一个实验表语句如下 SQL> create table test(id number,name varchar2(10)); 当我们在SQLPLUS里面敲入下面的语句并回车执行的时候,SQL ...
- iptable防火墙案例
[root@WX020 firewall]# cat /etc/sysconfig/iptables# Firewall configuration written by system-config- ...
- 结对编程——四则运算器(UI第十组)
博客目录: 一.问题描述 二.设计思路 三.UI开发过程 四.对接过程 ...
- 获取WebService的请求信息
一个已经写好的项目中有多个WebService,由于之前没有记录请求信息的,有时候需要查错等需要找到当次的请求信息,所以需要加入记录请求信息的功能. 首先想到的是在每一个带有WebMethod特性的方 ...