LinuxQuestions.org
Review your favorite Linux distribution.
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 05-29-2014, 09:56 AM   #1
Rooting
LQ Newbie
 
Registered: May 2014
Posts: 8

Rep: Reputation: Disabled
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.
 
Old 05-29-2014, 11:28 AM   #2
JeremyBoden
Senior Member
 
Registered: Nov 2011
Distribution: Debian
Posts: 1,187

Rep: Reputation: 243Reputation: 243Reputation: 243
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.
 
Old 05-29-2014, 01:33 PM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,621

Rep: Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577
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.
 
Old 05-29-2014, 01:47 PM   #4
JeremyBoden
Senior Member
 
Registered: Nov 2011
Distribution: Debian
Posts: 1,187

Rep: Reputation: 243Reputation: 243Reputation: 243
Would setuid work here?
 
Old 05-29-2014, 02:24 PM   #5
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,621

Rep: Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577
Quote:
Originally Posted by JeremyBoden View Post
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.)
 
1 members found this post helpful.
Old 05-29-2014, 06:17 PM   #6
Rooting
LQ Newbie
 
Registered: May 2014
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by JeremyBoden View Post
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 "("?
 
Old 05-29-2014, 06:22 PM   #7
Rooting
LQ Newbie
 
Registered: May 2014
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by rknichols View Post

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?
 
Old 05-29-2014, 08:16 PM   #8
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,621

Rep: Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577
Quote:
Originally Posted by Rooting View Post
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.
 
Old 05-29-2014, 08:24 PM   #9
Rooting
LQ Newbie
 
Registered: May 2014
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by rknichols View Post
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.
 
Old 05-29-2014, 09:53 PM   #10
Rooting
LQ Newbie
 
Registered: May 2014
Posts: 8

Original Poster
Rep: Reputation: Disabled
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)
 
Old 05-30-2014, 07:29 AM   #11
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,417

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
This is a good intro to the cmd line http://rute.2038bug.com/index.html.gz
 
Old 05-30-2014, 09:33 AM   #12
Rooting
LQ Newbie
 
Registered: May 2014
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by chrism01 View Post
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Device Driver /Instruction Set Question theKbStockpiler Linux - General 6 06-26-2012 01:53 PM
a newbie question about instruction set japloy Programming 2 11-28-2009 01:04 AM
Basic mail server setup instruction question NightSky Slackware 2 11-21-2008 01:28 AM
network class nomenclature drkstr Linux - Networking 2 09-27-2006 12:37 AM
Which linux instruction is equivalent to windows' instruction "tracert"? backpacker Linux - Software 1 04-04-2006 11:55 PM

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

All times are GMT -5. The time now is 12:28 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration