FRIHOSTFORUMSSEARCHFAQTOSBLOGSCOMPETITIONS
You are invited to Log in or Register a free Frihost Account!


KDE - Su returned with an error(linux root error)





KHO
Ok, so one day my Opensuse 10.3 install works fine, the next I get this nasty message any time I try and do anything requiring root. Updates, Yast, configuring things, managing network...

The first step I took was to see if my root account was OK. So I logged into tty1 (CTRL+ALT+F1) as root with my pass. Worked fine. I was also able to launch Yast from there. I see an option for a system restore type of feature, but I want to save that for last as I had recently made a lot of changes to Samba. (one of which im sure did this to me).

I have done a little research, and discovered this may be something wrong with my hosts file. I checked it out in Yast, and it appears proper... and my hostname according to Yast is proper.....

Now I am lost, cause I don't have a file named hostname (which is part of the fix for this very problem in ubunto). And I have confirmed on another installation that I should not have this file.

Anyone have this problem before or know how to fix it?

Ok, I have used visudo -c as root in a terminal and the output it gives is as follows:

>>> sudoers file: syntax error, line 15 <<<
>>> sudoers file: syntax error, line 24 <<<
Warning: undeclared Host_Alias `LC_TELEPHONE' referenced near line 28
>>> sudoers file: syntax error, line 27 <<<
>>> sudoers file: syntax error, line 31 <<<
>>> sudoers file: syntax error, line 37 <<<
parse error in /etc/sudoers near line 15

Leading me to believe that theres something wrong with my sudoers file obviously. The last thing I did that may have effected this would be allowing super user control in Smb4K...... ya....... I thought that program was bugging up a little....
KHO
For the sake of keeping this help thread which will hopefully help others in this problem tiddy, I am posting the contents of my sudoers file here. They obviously point the finger at SMB4K.

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 env_keep = "LANG LC_ADDRESS LC_CTYPE LC_COLLATE
LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE LC_TIME LC_AL
L LANGUAGE LINGUAS XDG_SESSION_COOKIE"
# Comment out the preceding line and uncomment the following one if you need
# to use special input metho
ds. This may allow users to compromise  the root
# account if they are allowed to run commands without authentication.
#Defaults env_keep = "LANG LC_ADDRESS LC_CTYPE LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES LC_MONET
ARY LC_NAME LC_NUMERIC LC
_PAPER LC_TELEPHONE LC_TIME LC_ALL LANGUAGE LINGUAS XDG_SESSION_COOKIE XMODIFIERS GTK_IM_MODULE QT_IM_MODULE QT
_IM_SWITCHER"

# 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:
Defaults targetpw   # ask for the password of the target user i.e. root
ALL ALL=(ALL) ALL   # WARNING! Only use this together with 'Defaults targetpw
'!

# Runas alias specification

# User privilege specification
root    ALL=(ALL) SETENV: ALL

# Uncomment to allow people in group wheel to run all commands
# and set environment variables.
# %wheel        ALL=(ALL) SETENV: ALL

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

# Samples
# %users  ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
# %users  localhost=/sbin/shutdown -h now

# Entries for Smb4K users.
# Generated by Smb4K. Please do not modify!
User_Alias      SMB4KUSERS = andy
Defaults:SMB4KUSERS     env_keep="PASSWD USER"
SMB4KUSERS      linux-laptop80g = NOPASSWD: /opt/kde3/bin/smb4k_kill
SMB4KUSERS      linux-laptop80g = NOPASSWD: /opt/kde3/bin/smb4k_umount
SMB4KUSERS      linux-laptop80g = NOPASSWD: /opt/kde3/bin/smb4k_mount
# End of Smb4K user entries.


This is where the problem lies, Now, since I know what lines the problem persists on. My next idea is to find a copy of the sudoers that is correct, and I can modify mine accordingly. I found alot of info about it here http://www.gsp.com/cgi-bin/man.cgi?section=5&topic=sudoers and have begun trying to manually repair the broken lines using visudo.

I have manually repaired what appear to be broken lines on the comments in the code in the sudoers file. My new code is shown below.
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 env_keep = "LANG LC_ADDRESS LC_CTYPE LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE LC_TIME LC_ALL LANGUAGE LINGUAS XDG_SESSION_COOKIE"
# Comment out the preceding line and uncomment the following one if you need
# to use special input methods. This may allow users to compromise  the root
# account if they are allowed to run commands without authentication.
#Defaults env_keep = "LANG LC_ADDRESS LC_CTYPE LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE LC_TIME LC_ALL LANGUAGE LINGUAS XDG_SESSION_COOKIE XMODIFIERS GTK_IM_MODULE QT_IM_MODULE QT_IM_SWITCHER"

# 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:
Defaults targetpw   # ask for the password of the target user i.e. root
ALL ALL=(ALL) ALL   # WARNING! Only use this together with 'Defaults targetpw'!

# Runas alias specification

# User privilege specification
root    ALL=(ALL) SETENV: ALL

# Uncomment to allow people in group wheel to run all commands
# and set environment variables.
# %wheel        ALL=(ALL) SETENV: ALL

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

# Samples
# %users  ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
# %users  localhost=/sbin/shutdown -h now

# Entries for Smb4K users.
# Generated by Smb4K. Please do not modify!
User_Alias      SMB4KUSERS = andy
Defaults:SMB4KUSERS     env_keep="PASSWD USER"
SMB4KUSERS      linux-laptop80g = NOPASSWD: /opt/kde3/bin/smb4k_kill
SMB4KUSERS      linux-laptop80g = NOPASSWD: /opt/kde3/bin/smb4k_umount
SMB4KUSERS      linux-laptop80g = NOPASSWD: /opt/kde3/bin/smb4k_mount
# End of Smb4K user entries.


However it seems I can't save it for some reason... but I think I caught all the errors now. If I could only figure out how to save the dang thing I would be set!

And after another few minutes of playing with the vi editor, I figured out to press ctrl+c then :save! /etc/sudoers and that saved it. I ran another check with visudo -c and it parsed OK!

I then attempted to run an update, and it now asks for root password instead of giving me an error! May this help everyone who is having trouble with this problem. Just edit the sudoers file (make a backup first) and make sure all the line breaks are in place. Read through it all.
jackill
It's necessary to edit sudo file ONLY with visudo: http://www.gratisoft.us/sudo/man/visudo.html to avoid syntax errors, which may occur serious problems with system accounts.
KHO
Yes, I used visudo, but visudo sets up a default text editor using it as a protocol. My editor it defaults to is vi. However I ran through visudo. The problem is solved, I merely kept the post up in case anyone with this problem happened to stumble across it.
xbcd
did u install kdesu cause that is probably the easiest fix. when i was in kde i used gksu since it worked fine too.
jeremyp
Hi KHO,

My first observation is that your original sudoers file has lots of line breaks in the middle of some of the very long lines. This may be a problem with your sudoers file or an artefact of the way you pasted it ito the message, I'm not sure.

My second observation is that you have defaults targetpw which means that you get asked for the target (i.e. root password) instead of your own. It's not a big deal, but I prefer it the other way. That way you can set root's password to something completely unusable which some consider a minor security enhancement.

My third observation is that visudo respects the EDITOR environment variable, so if you have some other editor than vi that you want to use, you can set it up in your profile e.g. in .bash_profile
Code:

EDITOR=/usr/bin/emacs
export EDITOR
[/code]
Related topics
how do you get linux
UBUNTU HELP!!
Installing Apache Php and MySQL [newbie tutorial]
How many times have you seen crash?
linux on a dell laptop
How Can I Make My PC as Mac As Possible?
Windows doesn't installs partition table damage
[var]COMO CONVENCER A UN WINDOUSERO XA Q USE LINUX
Current HDD Setup? OS Config?
Qual a melhor ferramenta para criar web sites?
¿Vale la pena cambiarse a Linux?
En octubre aparecerá una versión móvil de Ubuntu Linux
Bad experience many moons ago kept me away from linux.
Failed to initialize common updater subsystem
Reply to topic    Frihost Forum Index -> Computers -> Computer Problems and Support

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.