I would like to run fastboot
command without sudo
. it's working if I put sudo
in front of it, otherwise it wont.
like this:
$ sudo fastboot devices
2738006a fastboot
$ fastboot devices
no permissions fastboot
How do I solve this?
command linepermissionssudo
I would like to run fastboot
command without sudo
. it's working if I put sudo
in front of it, otherwise it wont.
like this:
$ sudo fastboot devices
2738006a fastboot
$ fastboot devices
no permissions fastboot
How do I solve this?
Best Answer
Using sudoers file
The correct way is to add a line into your
/etc/sudoers
file similar to:which means this specific 'username' is able to run
fastboot
command usingsudo
without providing any password asanyone
.Now when you run it using
sudo fastboot
it won't ask you for password and is a little bit faster to work with.Then simply add a simple alias to your
.bashrc
:Using SUID bit
I highly recommend the above solution over this one;
If your
fastboot
program is a binary file you can do as follow:First we make sure that
root
is the owner of this file and also it belongs to your primary group, then we make it possible for the owner and group to run this file while adding the SUID bit (4) which means file will be run with the owner's rights (root).Now it should work without sudo, however only root and you are able to run it.