LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-24-2006, 12:00 PM   #1
DeekBeek
Member
 
Registered: Mar 2005
Distribution: Ubuntu 14.04 LTS 64-bit
Posts: 127

Rep: Reputation: 15
Trying to get sudo to work in a .desktop icon command, under SUSE 10.1


Allright, things have been changed with the sudo program in SUSE 10.1. Does anybody out there want to give me the short version? I've consulted man visudo, man sudoers, and I'm not getting very far. I'm thinking that there's an additional text file to edit, somewhere.
I had the Netzero dialer installed under SUSE 10.0 so that I could run it with the following Command line in the .desktop file:
Code:
sudo /opt/nzclient/runclient.sh
The above, of course, did not work without the following change in the sudoers file, made with visudo (and checked with visudo -c afterwards), in the User privilege specification section of the file:

Code:
deekbeek           ALL=NOPASSWD: /opt/nzclient/runclient.sh
"deekbeek", you understand, stands for my actual username, which is in lowercase, also (maybe after today, "deekbeek" should be my real name).
In spite of all this preparation, I can't run the Netzero dialer as anything but root, anymore; I could run it under sudo as a regular user in SUSE 10.0 with the preparations cited.
On the light side, any Linspire users can't brag about the Netzero dialer being theirs. Use alien to change netzero.deb to an rpm, install it with the new right-click software installer (forget Yast), change permissions for read, write and execute in the nzclient folder (and all subfolders), and there you have it. It's still for (GROAN) root only use in that state, though.
 
Old 07-24-2006, 01:10 PM   #2
spirit receiver
Member
 
Registered: May 2006
Location: Frankfurt, Germany
Distribution: SUSE 10.2
Posts: 424

Rep: Reputation: 33
I'd say that line in /etc/sudoers looks all right. What happens if you invoke the sudo command from the console?
 
Old 07-24-2006, 01:47 PM   #3
DeekBeek
Member
 
Registered: Mar 2005
Distribution: Ubuntu 14.04 LTS 64-bit
Posts: 127

Original Poster
Rep: Reputation: 15
If I enter this in my user Konsole:
Code:
sudo /opt/nzclient/runclient.sh
the system gives back the message:
Code:
DM set to off
 
Old 07-24-2006, 02:36 PM   #4
spirit receiver
Member
 
Registered: May 2006
Location: Frankfurt, Germany
Distribution: SUSE 10.2
Posts: 424

Rep: Reputation: 33
I have no idea what that means, but at least there seems to be nothing wrong with the sudo part.
You say it works fine as root, so there must be something wrong with the environment. What does the following give?
Code:
sudo su - -c /opt/nzclient/runclient.sh
 
Old 07-24-2006, 05:50 PM   #5
DeekBeek
Member
 
Registered: Mar 2005
Distribution: Ubuntu 14.04 LTS 64-bit
Posts: 127

Original Poster
Rep: Reputation: 15
That's just a typist way of doing what I already do with GUI, the system asks for a root password (I didn't bother typing the password to see if it would connect).
 
Old 07-26-2006, 11:43 AM   #6
DeekBeek
Member
 
Registered: Mar 2005
Distribution: Ubuntu 14.04 LTS 64-bit
Posts: 127

Original Poster
Rep: Reputation: 15
I've visited /usr/share/doc/packages/sudo on my drive, and read the troubleshooting doc and then tried this in the Defaults section of the sudoers file:
Code:
Defaults always_set_home
Defaults env_reset
Defaults:deekbeek runas_default=/opt/nzclient/runclient.sh
The above was an add-on to the user privilege specification section containing:
Code:
deekbeek             ALL=NOPASSWD: /opt/nzclient/runclient.sh
It still doesn't work, I still can't start Netzero with the .desktop file(the Netzero icon) as user deekbeek, having the following under properties, application tab, command:
Code:
su /opt/nzclient/runclient.sh
the system still demands a root password, which means I'm still running netzero as root in spite of the changes. I don't know what gives. I also removed the two lines in the Defaults section that the first-installed sudoers file warns you to remove (doesn't help). I even commented out (used a #) on my other user privilege section line and tried:
Code:
deekbeek   ALL=(ALL) ALL
This does not help! I've thoroughly checked with visudo -c for sudoers corruption. I'd of had this problem solved in SUSE 10.0, by yesterday, maybe an hour after the first time I'd encountered it!
 
Old 07-26-2006, 12:04 PM   #7
berbae
Member
 
Registered: Jul 2005
Location: France
Distribution: Arch Linux
Posts: 540

Rep: Reputation: Disabled
To launch a program with sudo you must use:
sudo /opt/nzclient/runclient.sh
not
su /opt/nzclient/runclient.sh
as you seem to have under properties/application tab/command of the .desktop file
so replace su with sudo and it should work well with
deekbeek ALL=NOPASSWD: /opt/nzclient/runclient.sh
in the sudoers file
Don't use
deekbeek ALL=(ALL) ALL
for security reason.

Last edited by berbae; 07-26-2006 at 12:21 PM.
 
Old 07-26-2006, 01:29 PM   #8
DeekBeek
Member
 
Registered: Mar 2005
Distribution: Ubuntu 14.04 LTS 64-bit
Posts: 127

Original Poster
Rep: Reputation: 15
Thanks for spotting my typo. However, trying sudo instead of su again, which I already did with all of the conditions above, yesterday (and just tried it all again before my reply) using:
Code:
sudo /opt/nzclient/runclient.sh
in the command line of the application tab of the icon, still does not work. Using su was a typo on my part only today, in the posting. I tried sudo with everything, in the .desktop file command line, all over again to be sure. It doesn't work. I'm stuck using the arrangement as root and the stuff will not run as a different user (i.e., deekbeek). I only had to change one line in sudoers, and one in the .desktop file, when running SUSE 10.0 (I already hate 10.1)
 
Old 07-28-2006, 07:38 AM   #9
DeekBeek
Member
 
Registered: Mar 2005
Distribution: Ubuntu 14.04 LTS 64-bit
Posts: 127

Original Poster
Rep: Reputation: 15
Apologies to those to whose time I have wasted with typographical errors. I am compelled to re-summarize my unresolved problem (side-stepping the overshadowing problem that SUSE 10.1 has a bad on-line updater zenworks/Yast fiasco, and I can't add a crypt partition or use encfs, etc.):

I have been able to run Netzero, which defaults it's installation to use by the root user only, as a non-root user, without being prompted to enter a password. I have been able to take this for granted and able to continuously do it with SUSE Linux versions 9.2 and 10.0. The actual program is the Netzero dialer (installed from an .rpm made by the alien program, out of the downloaded netzero.deb file). The circumstances which have allowed me to do this included editing the sudoers file, and then entering sudo (which I typographically mixed up with su, earlier, but I did not insert it as an actual syntax error in my trials; I checked this) at the start of the command line in the command box, under the application tab, produced by the properties pull-down of the netzero.desktop file(i.e., the icon).
Now that I have SUSE Linux 10.1 installed, I can no longer accomplish this. I tried placing the following line in the user privilege specification section of the sudoers file:

Code:
deekbeek             ALL=NOPASSWD: /opt/nzclient/runclient.sh
That line was paired with this following line in the command box under the application tab of the properties pull-down of the netzero.desktop file icon:

Code:
sudo /opt/nzclient/runclient.sh

The changes above will not run Netzero (logged in as the user deekbeek under SUSE 10.1) from a click on the Netzero icon, and those changes only always did run Netzero under SUSE 10.0 or 9.2 (again, as the non-root user deekbeek). I can only run this as root now, with root typed into the run as a different user box under the activated check box, under advanced options of the application tab, under the properties pull-down of the netzero.desktop icon. I also always have to enter the root password in a popup prompt, presently.
I am including the full contents of my present sudoers file in the code section below; can anybody tell me exactly which lines to change and where, so that I may return to running Netzero as a non-root user? You will notice commented-out lines which I have also tried (in the defaults and user privilege specification section), due to having already consulted the troubleshooting document in /usr/share/doc/packages/sudo. I have always run the visudo -c command after edits, to ensure a non-corrupt sudoers file :

Code:
# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the sudoers man page for the details on how to write a sudoers file.
#

# Host alias specification

# User alias specification

# Cmnd alias specification

# Defaults specification

# prevent environment variables from influencing programs in an
# unexpected or harmful way (CVE-2005-2959, CVE-2005-4158,
# CVE-2006-0151)
Defaults always_set_home
Defaults env_reset
# Defaults:deekbeek runas_default=/opt/nzclient/runclient.sh
# In the default (unconfigured) configuration, sudo asks for the root password.
# This allows use of an ordinary user account for administration of a freshly
# installed system. When configuring sudo, delete the two
# following lines:



# Runas alias specification


# User privilege specification
root    ALL=(ALL) ALL
# deekbeek             ALL=NOPASSWD: /opt/nzclient/runclient.sh

# Uncomment to allow people in group wheel to run all commands
# %wheel        ALL=(ALL)       ALL

# Same thing without a password
# %wheel        ALL=(ALL)       NOPASSWD: ALL

# Samples
# %users  ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
# %users  localhost=/sbin/shutdown -h now
                                                              39,1          Bot
 
Old 07-28-2006, 08:35 AM   #10
berbae
Member
 
Registered: Jul 2005
Location: France
Distribution: Arch Linux
Posts: 540

Rep: Reputation: Disabled
Does the sudo command work with another script/program to run as root?
Try to put in the sudoers file:
Quote:
deekbeek ALL=NOPASSWD: some/other/program/or/script
and run in a console under deekbeek login:
Quote:
sudo some/other/program/or/script
Look in /var/log/messages if there are errors.
Also check if you have a /var/run/sudo directory which is owned by root with permissions drwx------
 
Old 07-31-2006, 01:12 PM   #11
DeekBeek
Member
 
Registered: Mar 2005
Distribution: Ubuntu 14.04 LTS 64-bit
Posts: 127

Original Poster
Rep: Reputation: 15
I think it's time to look for another ISP, then. I lack a similar external program package installed in a similar-enough way to consider trying to run it with sudoers and sudo (as a test). I have error messages logged, about sudo failing to run, which I expect. The permissions are as you state.
I don't have time for this, because I cannot apply any update patches in SUSE 10.1.
 
Old 08-12-2006, 08:17 PM   #12
DeekBeek
Member
 
Registered: Mar 2005
Distribution: Ubuntu 14.04 LTS 64-bit
Posts: 127

Original Poster
Rep: Reputation: 15
Here it is, then. I signed up with allvantage.com today. It works easily enough run as a regular user from kinternet, but I can't figure out a kppp setup, yet (I'd like that better, since it can store all the access numbers on my Desktop).
 
  


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
Made new icon on Desktop, can't get it to work bhert Linux - Newbie 7 07-01-2006 11:55 PM
Making a desktop icon work 357mag Mandriva 14 03-08-2005 08:54 AM
How does one creating printer icon on the desktop... SuSe/KDE? pwillikers Linux - Newbie 1 10-12-2004 06:39 PM
CD-icon on desktop does not work jesper54 Linux - Newbie 2 10-11-2004 12:41 PM
SuSE 9.1 users: desktop icon mouseclick behaviour C38368 Linux - Distributions 2 05-28-2004 12:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:26 PM.

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