---
title: Reset the forge sudo password in Laravel Forge
date: 2025-01-30T08:56:00-05:00
author: John Morton
canonical_url: "https://supergeekery.com/blog/reset-the-forge-sudo-password-in-laravel-forge"
section: Blog
---
# Reset the forge sudo password in Laravel Forge

*January 30, 2025* by John Morton

![Recipe new sudo pw](https://static.supergeekery.com/site-assets/recipe-new-sudo-pw.png)

*Audio narration available for this post.*

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.

The bash script reads: echo. forge. colon. new sudo password. followed by a pipe symbol. and C. H. P. A. S. S. W. D.

```plaintext
echo "forge:NEW_SUDO_PASSWORD" | chpasswd
```

---

**Tags:** webdev
