4
Ubuntu Server 12.04
On a remote server that I ssh into I have set up a special user with:
sudo adduser --system --disabled-login --disabled-password --group suser
to run some maintenance functions. On occasions I su into a login session for suser
with:
sudo su -l suser -s /bin/bash
to do some tasks... however I particularly want to be able to run some git commands via:
sudo su suser -c <COMMAND>
from my real user and no login to the suser.
Unfortunately I haven't been able to determine HOW I go about that. I have tried the only ways that makes sense to me:
sudo su suser -c git clone https://example.com/repos/project.git
sudo su suser -c "git clone https://example.com/repos/project.git"
or even
sudo su suser -c mkdir /home/suser/test
sudo su suser -c "mkdir /home/suser/test"
but nothing happens and I return to prompt. Can anyone assist or explain why this isn't possible?
That's it... facepalm I was under the mistaken impression that since I wasn't doing
-l
, that I was keeping the current shell and environment. Thank you! – JDex – 2013-06-19T12:34:23.903