1

According to this DevStack guide, the following commands will give sudo privileges to the stack user:

apt-get install sudo -y || yum install -y sudo
echo "stack ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers

How does that work? What does each part of those commands do?

7
  1. apt-get install sudo -y - Used to install sudo package in Debian based systems and y is used to specify yes during installation.
  2. yum install -y sudo - Used to install sudo package in fedora based systems and y is used to specify yes during installation.
  3. echo "stack ALL=(ALL_ NOPASSWD: ALL" >> /etc/sudoers - Concatenating the line stack ALL=(ALL_ NOPASSWD: ALL to the end of /etc/sudoers file.

Basically, you are installing the sudo package for a Debian or fedora based system and giving the user stack the right to run commands with sudo by appending that line to the /etc/sudoers file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.