Anyone who has used Multipass or AWS is familiar with the ubuntu
user who has passwordless sudo access. I am launching multiple virtual machines via multipass
each with many users and I want passwordless sudo for their accounts for two reasons
- They can only login with their public/private and not a username/password so they can't type in a password for
sudo
if they don't have one - Developers need to be able to call
sudo apt-get
I am aware that I can issue the command sudo visudo
and make some changes to provide passwordless sudo, however, this requires human interaction. I tried hacking this with sed (sudo sed -i "s/%admin\s*ALL=(ALL)\s*ALL/%admin ALL=(ALL) NOPASSWD:ALL/g" /etc/sudoers
) but something breaks and then I can't get into /etc/sudoers
, not even with the ubuntu
user.
Finally, I tried looking at the groups that ubuntu
is a member of and noticed that it is a member of adm
which I assume is admin, and I [blindly] added all the user accounts to that group but that did not work either.
I have two questions, which are really the same question
- How is it that Ubuntu can call sudo without a password and where is this specified?
- How can I extend this same privilege to other users but in an automated fashion?
cat | sed | tee
combination is usesless use ofcat
andsed
. You can simply usesed -i '...' /etc/sudoers
.