As root I would like to login as a service user (jenkins – the CI server) and manipulate files with its user,group and umask settings.
Normally I would (as root) do sudo -i -u jenkins
, or even su - jenkins
. However jenkins' default shell is /bin/false, which exits immediately.
Is there a way to login as Jenkins but specify a different shell to use? Do I really have to change jenkins' shell in /etc/passwd/
?
Best Answer
su on linux supports setting the shell with the
--shell
optionYou will need to su as root for this to work. From the man page: