I would imagine only certain commands are allowed to be run as sudo, without using a password
Now you tell us what happens when running sudo -S, but not when running the actual command specified in the docs?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi all,
Hoping this one might be easy.
I'm using Laravel Forge for my deployments and making use of Spatie's fantastic Browsershot.
I can't seem to use the sudo command as part of the Deploy Script.
I've tried the following sudo -S, but just receive
[sudo] password for forge:
sudo: no password was provided
My initial assumption is that the password is automatically injected and handled by the forge script.
Do I have to find and inject the password in to the script to run this, even though I can see the script using sudo -S successfully a bit further down?
( flock -w 10 9 || exit 1
echo 'Restarting FPM...'; sudo -S service $FORGE_PHP_FPM reload ) 9>/tmp/fpmlock
For context I am trying to use the following install instructions found here for Browsershot on Laravel Forge.
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget libgbm-dev
sudo npm install --global --unsafe-perm puppeteer
sudo chmod -R o+rx /usr/lib/node_modules/puppeteer/.local-chromium
Any help on how to use sudo command successfully would be greatly appreciated
Please or to participate in this conversation.