I try to migrate a smart contract to a private network via truffle on Windows 10. I specify a certain account in truffle.js and so far I get the following error:

Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: authentication needed: password or unlock

What is the best way or the best ways to unlock the (remote) account so that the migration via migrate --network networkName can take place?


2 Answers 2


There might be a newer, better way, but this has always worked for me. Go to geth, and

web3.personal.unlockAccount(web3.personal.listAccounts[0], "<password>", 15000);

15000 (seconds) just tells it to keep the first account unlocked for a long time so you can work in peace.

Hope it helps.

  • Thanks. Yes that would be via running a local node or? I was wondering if that is possible via Truffle. Mar 11, 2017 at 8:39

The above did not work for me. This worked:

web3.eth.getAccounts( (err,res) => {first=res[0]; web3.eth.personal.unlockAccount(first, "123456", 15000, (err,res)=>{console.log(err,res);} ) } );

Your Answer

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

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