megatools-passwd(1)
===================

NAME
----
megatools passwd - Change the password of a mega.nz account


SYNOPSIS
--------
[verse]
'megatools passwd' [--new-password <password>]


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

Changes the account password, the same way the mega.nz webclient does it in
Settings, Security. The files and keys in the account stay as they are: the
account's master key is only encrypted with a key derived from the new
password (with a new random salt).

Log in with the current password as usual (see the authentication options
below, or the config file). If the account uses two-factor authentication, the change needs a
code too ('--2fa-code', '--2fa-secret' or a prompt). The new password is
asked for twice on the terminal, or given with '--new-password'. It can't
be the same as the current one, and it can't start or end with whitespace.

Megatools keeps using its cached session after the change, with the new
password. If the old password is stored in a config file, update it there,
or the next login fails.

Only accounts with the current (v2) password scheme are supported. The
password of an old (v1) account can be changed in the mega.nz webclient.

Keep the account's recovery key (mega.nz webclient: Settings, Security,
Recovery key): it is the only way back in when the password is lost.


OPTIONS
-------

--new-password <password>::
	The new password. Without it the password is asked for on the
	terminal, which keeps it out of the shell history and the process
	list.

include::auth-options.txt[]
include::basic-options.txt[]


EXAMPLES
--------

* Change the password:
+
------------
$ megatools passwd -u your@email
Enter password for (your@email):
New password:
Repeat the new password:
Password changed. If it's stored in a config file (Password= in .megarc), update it there.
------------


include::footer.txt[]
