megatools-reg(1)
================

NAME
----
megatools reg - Register new Mega.nz account


SYNOPSIS
--------
[verse]
'megatools reg' [--scripted] --register --email <email> --name <realname> [--password <password>]
'megatools reg' [--scripted] --verify <state> <link>
'megatools reg' [--scripted] --verify --email <email> --password <password> <link>


DESCRIPTION
-----------

Registers new Mega.nz account. Registration is split into two steps:

. `--register`: Creates a new non-verified account
. `--verify`: Verifies account with the link that was sent to `<email>`

See example of registration below.


OPTIONS
-------

--register::
	Create new non-verified account.

--verify <state> <link>::
	Verify account previously created by `megatools reg --register`. You need to
	pass `<state>` that was returned from `megatools reg --register` and
	a verification link from the email that was sent to `<email>`.
+
*NOTE*: `<state>` contains keys derived from your password that are
sufficient to log in to the account. Keep it as private as the password.
States printed by megatools versions before 1.12 can't be used anymore.

--verify --email <email> --password <password> <link>::
	Same as above, if you no longer have the `<state>`. The verification
	link can be used again until the account is fully set up, so this form
	can also be used to retry an interrupted verification.

-e <email>::
--email <email>::
	The email address of the new account, which is also your login name.
	It is stored in lower case, spaces around it are dropped. The server
	rejects addresses that aren't valid.

-n <realname>::
--name <realname>::
	Your real (or fake) name.

-p <password>::
--password <password>::
	Plaintext password. No strength checking is done, so make sure you pick
	a strong password yourself. With --register, megatools asks for it
	(twice, without echo) when it's not given and stdin is a terminal, so
	it doesn't show up in the process list.

--scripted::
	With `--register`, print just the command that finishes the
	registration (`megatools reg --verify <state> @LINK@`), in a format
	suitable for scripts. With `--verify`, print nothing on success.

<link>::
	The link from the verification email
	(`https://mega.nz/#confirm...`), or just the code after `#confirm`.

include::basic-options.txt[]

EXAMPLE
-------

First create a non-verified account:

------------
$ megatools reg --register --email your@email.com --name "Your Name"
Password for the new account:
Repeat the password:

Registration email was sent to your@email.com. To complete registration, you must run:

  megatools reg --verify eW91ckBlbWFpbC5jb20:5u0o3J6o4yxK1x7CnT9gq0k1hZq0wK2b8W0ZQv3m8t4 @LINK@

(Where @LINK@ is registration link from the 'MEGA Signup' email)

Keep this command private, it can be used to log in to your account.
------------

Now wait for a verification mail and run the command as asked:

------------
$ megatools reg --verify eW91ckBlbWFpbC5jb20:5u0o3J6o4yxK1x7CnT9gq0k1hZq0wK2b8W0ZQv3m8t4 \
    'https://mega.nz/#confirmQ29uZmlybUNvZGVWMj...'

Account registered successfully!
------------

Verification sets up the account's encryption keys in the same way the
mega.nz web client does, so the account can be used with any MEGA client.

To finish an interrupted verification, or when the state is lost, verify
with the email and password instead:

------------
$ megatools reg --verify --email your@email.com --password "Your Password" \
    'https://mega.nz/#confirmQ29uZmlybUNvZGVWMj...'
------------

In a script, `--scripted` prints the command to run, with @LINK@ to be
replaced by the link:

------------
$ megatools reg --scripted --register --email your@email.com --name "Your Name" \
    --password "Your Password"
megatools reg --verify eW91ckBlbWFpbC5jb20:5u0o3J6o4yxK1x7CnT9gq0k1hZq0wK2b8W0ZQv3m8t4 @LINK@
------------

Then log in as usual, e.g. with `megatools df -u your@email.com`.


include::footer.txt[]
