[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Need help running command as another user using su



2014-02-28 23:26 GMT+01:00 Karsten Hilbert <Karsten.Hilbert@gmx.net>:
> Does the "gnuhealth" user have a login shell ?

The user was created as a system user:
adduser --home /var/lib/gnuhealth --quiet --system --group gnuhealth

According to `adduser`'s manpage, for system users "The new system
user will have the shell /bin/false (unless overridden with the
--shell option), and have logins disabled."

Using the "--shell" option of su, it now works properly:

root@debiansid:~# su --shell /bin/sh -c whoami gnuhealth
gnuhealth
root@debiansid:~#

I'm going to test this for the real commands in gnuhealth's maintainer scripts.
Thanks for pointing me in the right direction.
   +Emilien


Reply to: