LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-17-2011, 12:23 PM   #1
mafesabu
LQ Newbie
 
Registered: Jan 2011
Posts: 6

Rep: Reputation: 0
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!!! =)
 
Old 02-17-2011, 12:27 PM   #2
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 312Reputation: 312Reputation: 312Reputation: 312
sudo does not ask for the root password.
 
Old 02-17-2011, 12:49 PM   #3
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339

Rep: Reputation: 260Reputation: 260Reputation: 260
What did you define in /etc/sudoers?
 
Old 02-18-2011, 12:22 PM   #4
mafesabu
LQ Newbie
 
Registered: Jan 2011
Posts: 6

Original Poster
Rep: Reputation: 0
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 !!! =)
 
Old 02-18-2011, 12:31 PM   #5
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339

Rep: Reputation: 260Reputation: 260Reputation: 260
Quote:
Originally Posted by mafesabu View Post
user_name ALL=(ALL) ALL
Good. Do you see any "Defaults targetpw" in the file?

Quote:
Originally Posted by mafesabu View Post
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.
 
Old 02-18-2011, 12:35 PM   #6
fbobraga
Member
 
Registered: Jul 2010
Location: São Paulo - Brasil
Distribution: Debian 7 / Crunchbang 11
Posts: 229

Rep: Reputation: 41
Quote:
Originally Posted by mafesabu View Post
1. YES! it asks password.
but not root's, it asks for the user password :P
 
  


Reply

Tags
exec, shell, sudo



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how can I execute two commands on exec of a find? eantoranz Programming 3 08-03-2010 04:51 PM
How to execute shell commands that require root password from PHP ? newbie_0404 Linux - Software 2 06-27-2010 08:16 AM
How to execute multiple commands with find and -exec... tomstratton Linux - General 6 05-26-2009 03:26 AM
how to let the php/apache have the privileges to execute all the root shell commands another 1 Linux - Server 18 03-24-2009 08:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration