I exported the private key from Metamask and wants to import it into geth. geth is running on Windows 10.

geth is started using

geth --rinkeby --rpc --rpcapi="personal,eth,network,net,web3" --rpcport 8545 --rpcaddr --unlock "0xcede48d8ac162d1b08ed9419010de3c99f2cfdd6" console

this prompts me to enter the password

Unlocking account 0xcede48d8ac162d1b08ed9419010de3c99f2cfdd6 | Attempt 1/3
Fatal: Failed to unlock account 0xcede48d8ac162d1b08ed9419010de3c99f2cfdd6 (no key for given address or file)

Why is it failing to unlock the account even though the password I entered into geth is the same password that was used to export the private key from Metamask?

  • Do you actually have the account in your keystore?
    – niksmac
    Commented Jul 13, 2018 at 7:00

2 Answers 2


I was having the same problem. strangely i seem to have gotten past it by first entering a blank password and then entering the real password on attempt 2/3. That worked for some reason...


What you can do is to create a new text file in the directory where the chain is stored and save the password in a text file called password.txt.

Example if password = '1234' and stored in a directory called 'chain'

echo '1234' > chain/password.txt

then run your code with the additional --password method

geth --rinkeby --rpc --rpcapi="personal,eth,network,net,web3" --rpcport 8545 --rpcaddr --unlock "0xcede48d8ac162d1b08ed9419010de3c99f2cfdd6" --password chain/password.txt console

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.