title: Permission denied with sudo
body: <p>in a buildroot environment I added one user to the group wheel. Now I can execute commands with the root's privileges using sudo.</p>
  
  <p>It seems it works but when I try to export a pin on my RPi I always get Permission denied:</p>
  
  <pre><code>rpi:~$ sudo echo 4 &gt; /sys/class/gpio/export
  sh: can't create /sys/class/gpio/export: Permission denied
  </code></pre>
  
  <p>Here the contents of that directory:</p>
  
  <pre><code>rpi:~$ ls -l /sys/class/gpio/
  total 0
  --w-------    1 root     root          4096 Jan  1 00:00 export
  lrwxrwxrwx    1 root     root             0 Jan  1 00:00 gpiochip0 -&gt; ../../devices/platform/soc/3f200000.gpio/gpio/gpiochip0
  --w-------    1 root     root          4096 Jan  1 00:00 unexport
  </code></pre>
  
  <p>Isn't enough to get the root's privilege with sudo to write in the export file? I'm afraid about the owner and groups. In fact if I type:</p>
  
  <pre><code>rpi:~$ sudo chmod a+w /sys/class/gpio/*
  </code></pre>
  
  <p>then I can successfully export the pin. But I don't know if this is the best way to do this.</p>