running a command in Ubuntu by runuser while the command has space

I want to run a command by a specific user in Ubuntu (16.04) when I have root access using:

sudo runuser -u myuser 'mkdir a'

but I receive this error:

runuser: failed to execute mkdir a: No such file or directory

I got the same error for all other commands that have a space. However, for a command like this:

sudo runuser -u myuser 'ls'

It works fine. Is there any suggestion what should I do?



Read more here: https://stackoverflow.com/questions/64948823/running-a-command-in-ubuntu-by-runuser-while-the-command-has-space

Content Attribution

This content was originally published by user3070752 at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: