I have a BusyBox system where I want to run a certain script as a non root user without a password while still in su
. Most answers which I found here use sudo
. I tried using su - user1 -c "echo '$USER'"
, for which I'm getting:
No directory, logging in with HOME=/
root
instead of:
user1
Is there a way to make this happen?