LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   nomenclature question - interpreting an instruction (https://www.linuxquestions.org/questions/linux-newbie-8/nomenclature-question-interpreting-an-instruction-4175506384/)

Rooting 05-29-2014 08:56 AM

nomenclature question - interpreting an instruction
 
I installed a new program, we'll call it "newprogram", and in the instructions for a separate graphical interface, I read this:

You need root privileges to run NewProgram hence it is recomend to enter the following line into sudoers:
%newprogram ALL=(root)NOPASWD:/usr/bin/newprogram


Simple, I'm sure, but it's greek to me. Here's my questions:

1. Do I have root privileges? I installed the Linux and I'm the only user.
2. How do you "enter a line into sudoers". Or, what is sudoers?
3. In the actual line, do I actually type "%", or is that supposed to mean something else?
4. I tried to type this exact line, but now I get an error every time I try to run the graphical interface because of the "(".
4a. What should it have been instead of (root)?
4b. Do I have to edit a file to get rid of the error, or will typing the line correctly correct the error?
5. What is the correct way to type this line?

Sorry if these questions are so fundamental, but it's only been one day since I installed Linux. The "distro" is Pinguy based on Ubuntu.

JeremyBoden 05-29-2014 10:28 AM

Don't do it!
You are being asked to give anybody authority to run "newprogram" with rights to change/delete anything on your PC.

Why not just type
Code:

sudo newprogram
followed by your own password, if prompted for.
You shouldn't need to be running programs with administrator rights from a GUI.

rknichols 05-29-2014 12:33 PM

It's not that bad.
Code:

%newprogram ALL=(root)NOPASWD:/usr/bin/newprogram
grants permission only to users who are a member of the "newprogram" group to execute /usr/bin/newprogram with root privileges without entering a password. You would have to have created a group by that name and added one or more users to that group. Whether it's important to be able to run the program that way depends on what the program does and how you plan to invoke it. For example, if you want to invoke it via a cron or at job, where there is no opportunity to enter a password, then it would be important to have that line in /etc/sudoers.

You edit the sudoers file by running visudo (as root), which will bring up that file in an editor (/bin/vi by default) and check that whatever you enter is syntactically valid before updating the /etc/sudoers file.

JeremyBoden 05-29-2014 12:47 PM

Would setuid work here?

rknichols 05-29-2014 01:24 PM

Quote:

Originally Posted by JeremyBoden (Post 5178848)
Would setuid work here?

It could, but that is significantly less secure than using sudo. Setuid lets anyone with execute permission on the file run it with root permissions, and without the cleansing of the environment that sudo performs and without the automatic sudo logging of the action. sudo also gives you the ability to restrict arguments a user can utilize with the program. (No, the suggested sudoers line does not make use of that.)

Rooting 05-29-2014 05:17 PM

Quote:

Originally Posted by JeremyBoden (Post 5178761)
Don't do it!
You are being asked to give anybody authority to run "newprogram" with rights to change/delete anything on your PC.

Why not just type
Code:

sudo newprogram
followed by your own password, if prompted for.
You shouldn't need to be running programs with administrator rights from a GUI.

I tried that, but I'm getting an error:

[no:/home/no] $ sudo newprogram
[sudo] password for no:
/usr/bin/newprogram: 1: /usr/bin/newprogram: Syntax error: "(" unexpected

I've tried uninstalling the program and reinstalling it, but this error still occurs. Where can I find and edit/remove the "("?

Rooting 05-29-2014 05:22 PM

Quote:

Originally Posted by rknichols (Post 5178842)

You edit the sudoers file by running visudo (as root), which will bring up that file in an editor (/bin/vi by default) and check that whatever you enter is syntactically valid before updating the /etc/sudoers file.

I'm having another problem:

visudo: /etc/sudoers: Permission denied

Really?

rknichols 05-29-2014 07:16 PM

Quote:

Originally Posted by Rooting (Post 5179014)
I'm having another problem:

visudo: /etc/sudoers: Permission denied

Really?

As I said, you need to do that as root, either from a root shell or by running "sudo visudo", depending on how your system is set up.

Rooting 05-29-2014 07:24 PM

Quote:

Originally Posted by rknichols (Post 5179051)
As I said, you need to do that as root, either from a root shell or by running "sudo visudo", depending on how your system is set up.

I typed "cd /." without the quotes but with the period.

I think I don't know how to change to root. I assume it's not Cd (root).

I'll try the sudo visudo.

Rooting 05-29-2014 08:53 PM

Problem solved! Well, I got the program working. It turned out I had a faulty download and the installation was screwed.

So now the program works perfectly, and without a GUI!

I'll start reading a bit more now that I have the setup I was hoping for, because I have much to learn.

Grasshopper (aka Rooting)

chrism01 05-30-2014 06:29 AM

This is a good intro to the cmd line http://rute.2038bug.com/index.html.gz

Rooting 05-30-2014 08:33 AM

Quote:

Originally Posted by chrism01 (Post 5179281)
This is a good intro to the cmd line http://rute.2038bug.com/index.html.gz

Thanks. This reminds me of learning French: Deceptively easy at first, but finally very challenging.


All times are GMT -5. The time now is 05:59 AM.