If I do
su - -c 'mkdir bin' user1
then I get
su: /usr/bin/ksh: No such file or directory
because the users shell is set to
ksh is not installed.
How do I carry commands out as the user in such a case?
If you don't put the
It appears that I misunderstood your actual problem. As other have said
I believe the -s/--shell option to su lets you pick the shell to use while keeping the other parts of users environment, /bin/sh is specified by posix so should be available everywhere.
You can use:
I dropped the