Where is the runuser command on Ubuntu Server?
From your comment on the other answer:
When I do
su - otheruser
, I am gettingNo directory, logging in with HOME=/
. Then when I runwhoami
, I getroot
.
This happens because 'otheruser' hasn't got a shell (like bash). It's probably something like /bin/false. If you want a shell as 'otheruser', use this instead:
sudo -u otheruser /bin/bash
On Ubuntu you have su
and sudo
for this sort of thing:
su - username
Changes to user username
, as if that user had logged in.
sudo -u username command
Run a single command as user username
.