I have a bash script that i have to run inside my container as user ‘myself’
On host this work good but it will execute script as root.
lxc exec c1 – /bin/bash -c " . /setup.sh"
I want to run this script as user -‘myself’
My try First:
lxc exec c1 -- /bin/bash -c " su myself && sudo . /setup.sh"
( I get inside container as myself but the next part to run ./setup.sh doesn’t work)
myself@c1:/root$
Second try:
lxc exec c1 -- sudo --login --user myself && sudo . /setup.sh
same thing …
myself@c1:/root$
Is it possible to run a script inside lxd container from host as a user of lxd container?