title: Giving an executable more permissions than running user
body: <p>I have a small C++ app to turn on and off lights for a BeagleBone Black board that runs on Debian 9.2.</p>
  
  <p>It does this by updating text files.</p>
  
  <pre><code>// Turn light on
  fs.open("/sys/class/leds/beaglebone:green:usr0", std::fstream::out);
  fs &lt;&lt; "1";
  fs.close();
  </code></pre>
  
  <p>If I run the program as a standard user it runs without error but none of the lights change.</p>
  
  <p>If I run the program with <code>sudo</code> everything works fine and the lights work. 
  I'm guessing it's because those files needs higher access.</p>
  
  <p>I'm not super familiar with Linux permissions but is there a way to allow your program access to the files where a user could not?</p>