LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Execute EXEC or SHELL as a root (https://www.linuxquestions.org/questions/linux-newbie-8/execute-exec-or-shell-as-a-root-863356/)

mafesabu 02-17-2011 12:23 PM

Execute EXEC or SHELL as a root
 
Hello, can i execute this line:

sudo ln -b /dev/ttyUSB0 /dev/ttyS0

From gambas in a virtual terminal/consol, without it ask me the root's password???

I tried like this:

EXEC ["sudo", "ln", "-b", "/dev/ttyUSB0 /dev/ttyS0"] WAIT

and this

SHELL "sudo ln -b /dev/ttyUSB0 /dev/ttyS0" WAIT

and it doesn't work.... plase someine Help ME!!! =)

andrewthomas 02-17-2011 12:27 PM

sudo does not ask for the root password.

Reuti 02-17-2011 12:49 PM

What did you define in /etc/sudoers?

mafesabu 02-18-2011 12:22 PM

1. YES! it asks password.

2. I tried everything =(
in /etc/sudoers i tried to give permision like this:

user_name ALL=(ALL) ALL

and also:

unser_name ALL = NOPASSWD:/dev/ttyUSB0 /dev/ttyS0

and it doesn't work..... Please HElp Me !!! =)

Reuti 02-18-2011 12:31 PM

Quote:

Originally Posted by mafesabu (Post 4262972)
user_name ALL=(ALL) ALL

Good. Do you see any "Defaults targetpw" in the file?

Quote:

Originally Posted by mafesabu (Post 4262972)
unser_name ALL = NOPASSWD:/dev/ttyUSB0 /dev/ttyS0

This makes no sense, as you have to specify the granted command, i.e. /bin/ln, therein instead. But the first rule you mentioned should do already.

fbobraga 02-18-2011 12:35 PM

Quote:

Originally Posted by mafesabu (Post 4262972)
1. YES! it asks password.

but not root's, it asks for the user password :P


All times are GMT -5. The time now is 08:42 PM.