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 ...
随机推荐
- JDBC进行事务管理
JDBC进行事务管理 事务的四个特征:原子性 : 是指事务中包含的操作都被看做是一个逻辑单元一致性: 开始前和结束后数据库都处于一致性状态隔离性: 对数据库修改的多个事务是彼此隔离的持久性 事务完成之 ...
- MyBatis入门(二)—— 输入映射和输出映射、动态sql、关联查询
一.输入映射和输出映射 1. parameterType(输入类型) 1.1 传递简单类型 <select id="getUserById" parameterType=&q ...
- java:tag 自定义标签应用
一,tag类 1.1 TagMy标签类,格式化当前日期并输出 package com.dkt.tag; import java.io.IOException; import java.text.Sim ...
- 在生产环境中安全执行更新删除SQL脚本的技巧
今天在生产环境上解决问题,由于广发银行的管理制度是开发公司是不允许确生产环境的,所以我们只能把要更新的语句发给运营中心,由运营中心的投产人员执行,我们则在旁边看着:在他执行的时候发现了一个很有趣的技巧 ...
- 拖拽进度条(SeekBar)
拖拽进度条(SeekBar) 监听方法:setOnSeekBarChangeListener 监听器:SeekBar.OnSeekBarChangeListener 简单,直接上代码: 1.Activ ...
- android:项目迁移error:Please change caller according to com.intellij.....
迁移到Android Studio中的项目,在运行时有时会在Event Log中报这种错: Please change caller according to com.intellij.openapi ...
- exception tomcat startup.bat 闪退
解决方案: startup.bat,右击->编辑,在文件头加入下面两行: SET JAVA_HOME=D:\Java\jdk1.7 (java jdk目录) SET TOMCAT_HOME=E: ...
- easyui 笔记
easyui-datagrid:loadFilter:处理服务器端传递过来的参数. 刷新datagrid:$("#xxx").datagrid('reload'): form 表单 ...
- Automate the Sizing of your SGA in Oracle 10g
How much memory does each of the individual components of the SGA need? Oracle now has methods to de ...
- 创建完美SDK的10个技巧
[编者按]本文作者为 Gal Lavinsky,文中将列出10个零基础小技巧,帮你创建完美的Java SDK.文章系国内 ITOM 管理平台 OneAPM 编译呈现.以下为正文. 本文起源于笔者朋友的 ...