Problem with "ghost restart"

Ghost-CLI version: 1.30.1
Ghost version: 6.55.0
Self-hosting
node v22.23.2

I have installed ghost successfully on Ubuntu 26.04 LTS.
Everything worked fine.

When try to restart ghost, usually, you’re prompted for the sudo password

ghost restart
+ sudo systemctl is-active ghost_localhost
? Sudo Password [input is masked]

But in this installation

ghost restart`
+ sudo systemctl is-active ghost_localhost

The script hangs here, because it doesn’t automatically prompt for the sudo password!

It only works if you enter it manually:

sudo systemctl restart ghost_localhost
[sudo: authenticate] Password:

and then

ghost restart

Can this be a bug of Ghost-Cli v1.30.1?
Should I give sudo visudo -f /etc/sudoers.d/ghost-restart a try?

Thanks for help.

Found the solution with the help of AI Claude:

The new server with Ubuntu 26.04 LTS use another “sudo”!
You have to choose /usr/bin/sudo.ws (classic sudo) = Number 1

update-alternatives --config sudo

 Selection    Path                     Priority   Status
------------------------------------------------------------
* 0            /usr/lib/cargo/bin/sudo   50        auto mode
  1            /usr/bin/sudo.ws          40        manual mode
  2            /usr/lib/cargo/bin/sudo   50        manual mode

Press <enter> to keep the current choice[*], or type selection number: 1

Now it works as expected.

ghost restart

Love open source? We’re hiring JavaScript Engineers to work on Ghost full-time.
https://careers.ghost.org

+ sudo systemctl is-active ghost_localhost
✔ Sudo Password
+ sudo systemctl restart ghost_localhost
✔ Restarting Ghost

Maybe this is helpfull for others.

Keep in mind, the /usr/bin/sudo.ws (classic sudo) is vulnerable:
Heap Buffer Overflow in Sudo (CVE-2021-3156) Enables Privilege Escalation on Linux OS

Maybe you can update Ghost-Cli in future versions!

A fix for this has been shipped in Ghost-CLI 1.31.0 :+1: