You are not logged in.

#1 2009-10-14 13:34:12

myxolam
Member
Registered: 2009-09-21
Posts: 12

su vs sudo : run dolphin as root[SOLVED]

Hi,
I am trying to understand the difference in how su and sudo work.
I tried to run dolphin as root to add a mount point at /media/drivex
with su :
I type dolphin at the prompt
and I get this error

<unknown program name>(2348)/: KUniqueApplication: Cannot find the D-Bus session server:  "Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken."

<unknown program name>(2347)/: KUniqueApplication: Pipe closed unexpectedly.

dolphin doesnt work

however,
when I use sudo dolphin from a regular user,
dolphin works even though I get a number of errs

Error: "/var/tmp/kdecache-myx" is owned by uid 1000 instead of uid 0.
kdeinit4: preparing to launch /usr/lib/libkdeinit4_kbuildsycoca4.so
kbuildsycoca4 running...

this is repeated a few times, as though it keeps retrying.

1.Anyway why does su not work when sudo does?
2. So when does one use su vs sudo?
3. I did this yesterday and was able to add a mnt point for my esata drive. Today, I had to do it again. The mount point had disappeared. what may have happened?
thanks

Last edited by myxolam (2009-10-16 11:27:15)

Offline

#2 2009-10-14 19:00:33

SternGerlachExperiment
Member
Registered: 2009-10-11
Posts: 51

Re: su vs sudo : run dolphin as root[SOLVED]

I can't give you any answers, but what if you tried

$ kdesu dolphin

?

Offline

#3 2009-10-14 19:26:21

flamelab
Member
From: Athens, Hellas (Greece)
Registered: 2007-12-26
Posts: 2,160

Re: su vs sudo : run dolphin as root[SOLVED]

Terminal apps: su, sudo
GUIs: kdesu, gksu

smile

Offline

#4 2009-10-15 00:28:58

myxolam
Member
Registered: 2009-09-21
Posts: 12

Re: su vs sudo : run dolphin as root[SOLVED]

I didnt realize that  ... still have a lot to learn here.
I did a little research based on your replies and it appears using su with graphical apps is really bad.
Something about iceauthority being compromised... anyway I didnt understand it but its good to know the right way to do it.
I will try this when I get on the linux computer.

thanks guys for the answers.

Offline

#5 2009-10-15 14:44:59

eazy
Member
From: London, UK
Registered: 2008-01-20
Posts: 97
Website

Re: su vs sudo : run dolphin as root[SOLVED]

The only reason I use "su" (as "su -") is to create a new, clean session, just as logging in with that user.

Using "sudo", or "su" without the dash creates a new environment inheriting the session variables from the current user, thus GUI apps can work fine (as they have inherited the $DISPLAY, $DBUS_SESSION_BUS_ADDRESS and other variables used by X applications).

Anyway, as an alternative to "su", you could use "sudo -i".

Another difference which is applicable to Ubuntu and maybe Arch, is that "su"ing to root you are asked for the root password, while using "sudo" you are asked for your password, not the "root" one.


no masters to rule us, no gods to fool us

Offline

#6 2009-10-15 15:21:14

myxolam
Member
Registered: 2009-09-21
Posts: 12

Re: su vs sudo : run dolphin as root[SOLVED]

thanks eazy,
that adds even more to the "to learn" list.
So many little nuances of the commands. I've got a long way to go.

Offline

Board footer

Powered by FluxBB