sudo clpctl not working resulting invalid directive #327

Closed
opened 2026-04-05 20:26:58 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @John-Henrique on 10/30/2023

CloudPanel version(s) affected

2.3.2

Description

SCENERY
User 'sudoers'
I try all this set (one time for each)
user1 ALL=(ALL) NOPASSWD: /usr/bin/clpctl
user1 ALL=(ALL) NOPASSWD: /bin/clpctl
user1 ALL=(ALL) NOPASSWD: ALL

When run

sudo clpctl site:add:php --domainName=domain.com --phpVersion=8.1 --vhostTemplate='Generic' --siteUser=johndd --siteUserPassword='!secretPassword!'

result this error

/usr/bin/clpctl: 5: printf: %q: invalid directive
bash: -c: line 1: unexpected EOF while looking for matching `"'
bash: -c: line 2: syntax error: unexpected end of file

When run using double quotes

sudo clpctl site:add:php --domainName=domain.com --phpVersion=8.1 --vhostTemplate="Generic" --siteUser=johndd --siteUserPassword="!secretPassword!"

result this error

-bash: !secretPassword!: event not found

How to reproduce

I my case just example command and get this error, never works in my install

sudo clpctl site:add:php --domainName=domain.com --phpVersion=8.1 --vhostTemplate="Generic" --siteUser=johndd --siteUserPassword="!secretPassword!"

All other CLPCTL command works fine.

Possible Solution

I don`t know

Additional Context

When running by root, works fine.

This privileges from this user

id user1
uid=1891(user1) gid=1891(user1) groups=1891(user1),27(sudo)
*Originally created by @John-Henrique on 10/30/2023* ### CloudPanel version(s) affected 2.3.2 ### Description **SCENERY** User 'sudoers' I try all this set (one time for each) user1 ALL=(ALL) NOPASSWD: /usr/bin/clpctl user1 ALL=(ALL) NOPASSWD: /bin/clpctl user1 ALL=(ALL) NOPASSWD: ALL When run ``` sudo clpctl site:add:php --domainName=domain.com --phpVersion=8.1 --vhostTemplate='Generic' --siteUser=johndd --siteUserPassword='!secretPassword!' ``` result this error ``` /usr/bin/clpctl: 5: printf: %q: invalid directive bash: -c: line 1: unexpected EOF while looking for matching `"' bash: -c: line 2: syntax error: unexpected end of file ``` When run using double quotes ``` sudo clpctl site:add:php --domainName=domain.com --phpVersion=8.1 --vhostTemplate="Generic" --siteUser=johndd --siteUserPassword="!secretPassword!" ``` result this error ``` -bash: !secretPassword!: event not found ``` ### How to reproduce I my case just example command and get this error, never works in my install ``` sudo clpctl site:add:php --domainName=domain.com --phpVersion=8.1 --vhostTemplate="Generic" --siteUser=johndd --siteUserPassword="!secretPassword!" ``` All other CLPCTL command works fine. ### Possible Solution I don`t know ### Additional Context When running by root, works fine. This privileges from this user ``` id user1 uid=1891(user1) gid=1891(user1) groups=1891(user1),27(sudo) ```
Sign in to join this conversation.