I and a friend are administrating a fair number of virtual machines, each one dedicated to some task in the overall system. When we need to administrate them, we typically log in as root, since the only time we log in to the machines at all are when we need to perform administrative tasks in them. We do not use sudo, since every command we do will typically be a sudo command.
We would prefer to keep our accounts separate on these machines, to give us separate .bash_history, see when the other one was last logged in, etc. To do that, we will need two accounts with full root permissions.
One method is to change our normal user accounts to have UID=0 GID=0, i.e. the same as root, however I was dissuaded from that solution in this question: Are there any gotchas with granting a user root privileges by making them UID=0 GID=0?
[That question is the same as this, up to here]
The answer in that question was to use sudo, but as I mentioned, sudo is very inconvenient for our use case. Almost all commands done on those VMs are sudo-commands (and | sudo tee >\dev\null
for every output redirect is mind numbing!), so sudo is likely more inconvenient than having separate histories and other account logging is an advantage.
My follow up question then becomes: Is there a reliable way to make several user accounts behave as root, apart from sudo? Or is there a way to make sudo more convenient (apart from sudo -i
which defeats the purpose).
sudo -s
work for you?sudo -i
, it makes us into root and we loose the separated account logging.$HOME
so you shouldn't be seeing that behavioursudo -s
depends on settings in/etc/sudoers
. On Red Hat family systems,$HOME
is reset. (It's really easy to cause problems for yourself otherwise, so I'm kind of surprised this isn't the default elsewhere.)