lunes, 2 de junio de 2014

This a good practice.

Made a script with the following commands

 #!/bin/bash

 sudo fdisk -l


 chmod 755 test

 username ~$  ./test
 [sudo] password for username:

 Trick edit visudo -f /etc/sudoers

# See sudoers(5) for more information on "#include" directives:

developer ALL=(ALL) NOPASSWD: /sbin/fdisk


 username ~$  ./test 

---------------------------------------------------------------------

#!/bin/bash

su -c "fdisk -l"

--------------------------------------------------------------------- 

/etc/sudoers en sus ubuntu. para que al tipear sudo [zanata] no pida password.  

# Allow members of group sudo to execute any command

%zanata ALL=(ALL) NOPASSWD: ALL 

No hay comentarios:

Publicar un comentario