Reset the forge sudo password in Laravel Forge
Have you misplaced the sudo password for your user and need to reset it?
In Laravel Forge, you can save reusable bash scripts in the control panel and run them as the root user. Save the following in a Recipe, updating NEW_SUDO_PASSWORD with your desired password each time. If you’re resetting a user other than forge, update the user. Run it on your server. Presto! You’ve got your sudo password back. The same script also works if you have root SSH access through your provider, like Digital Ocean.
echo "forge:NEW_SUDO_PASSWORD" | chpasswd