» Login

Command: vagrant login

The login command is used to authenticate with theHashiCorp's Vagrant Cloud server. Logging in is onlynecessary if you are accessing protected boxes or usingVagrant Share.

Logging in is not a requirement to use Vagrant. The vast majorityof Vagrant does not require a login. Only certain features such as protectedboxes or Vagrant Share require a login.

The reference of available command-line flags to this commandis available below.

» Options

  • —check - This will check if you are logged in. In addition to outputtingwhether you are logged in or not, the command will have exit status 0 if you arelogged in, and exit status 1 if you are not.

  • —logout - This will log you out if you are logged in. If you are alreadylogged out, this command will do nothing. It is not an error to call thiscommand if you are already logged out.

  • —token - This will set the Vagrant Cloud login token manually to the providedstring. It is assumed this token is a valid Vagrant Cloud access token.

» Examples

Securely authenticate to Vagrant Cloud using a username and password:

  1. $ vagrant login
  2. # ...
  3. Vagrant Cloud username:
  4. Vagrant Cloud password:

Check if the current user is authenticated:

  1. $ vagrant login --check
  2. You are already logged in.

Securely authenticate with Vagrant Cloud using a token:

  1. $ vagrant login --token ABCD1234
  2. The token was successfully saved.