When you are setting up your Neo4j server and you can’t have access to Neo4j Browser, mostly if you are using AWS EC2 or some remote system and don’t want to expose those 7474 7687 ports,

To set your initial password via command line do the following

delete dbms/auth file from your neo4j data directory

sudo rm -f /var/lib/neo4j/data/dbms/auth

Use neo4j-admin command set-initial-password

sudo -u neo4j neo4j-admin set-initial-password YOUR_NEW_PASSWORD