Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Security
User Name
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.


  Search this Thread
Old 06-12-2013, 03:06 PM   #1
Senior Member
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 1,631

Rep: Reputation: 112Reputation: 112
su vs gksu (who is doing what to whom?)

I was experimenting with launching an application as a different user. In this case the Calc application from LibreOffice. Why? A long story as documented in another post. That issue is history. Not resolved for other reasons but history. My experiment did bring up another question. Here is what I did on my test machine (LinuxMint 14 Mate desktop running under VMWare).

I created a new user, moe (one of the 3 stooges and my main test user )
I created a launcher on my (ken) desktop thusly
gksu -u moe "libreoffice --calc %U"
When I execute the launcher a dialog comes up and says
Enter your password to run the application 'libreoffice --calc as user moe
It requires MY (ken) password not moe's password.

If I execute su moe in a terminal I am asked for moe's password.

If I execute the launcher and then execute ps -aux in a terminal I see a libreoffice process owned by moe.

After executing su moe I find a bash proces owned by moe.

Upon reflection it occurred to me that I (ken) am a sudoer as I installed the OS with the ken account and thus its password can invoke root permissions. So I created another stooge account, larry. I logged into the machine as moe and created a Calc launcher to gksu to larry and invoke calc. This time I get an error
Failed to run libreoffife a--calc as user larry. The underlying authorization mechanism (sudo) does not allow you to run this program.
The man page for gksu tells me
gksu is a frontend to su and gksudo is a frontend to sudo.Their primary purpose is to run graphical commands that need root without the need to run an X terminal emulator and usingsu directly.
The -u option is supposed to
Call <command> as the specified user.
It appears that gksu is invoking sudo rather than su or am I missing something?


Old 06-13-2013, 11:06 PM   #2
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 666

Rep: Reputation: 68
Notice that all the magic is done by the underlying library, libgksu. Also notice that the library will decide if it should use su or sudo as backend using the /apps/gksu/sudo-mode gconf key, if you call the gksu command.
1 members found this post helpful.
Old 06-14-2013, 07:08 AM   #3
Senior Member
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 1,631

Original Poster
Rep: Reputation: 112Reputation: 112
Thanks Ygrex, I had reviewed some man pages on gksu, perhaps not the Ubuntu one. When I read "gksu is a front end for su and gksudo is a front end for gksu"... if I swing a hammer to drive a nail I do not expect it to change into a screwdriver and install a wood screw. But to get off my soap box - I added the -w option to gksu and it executes gksu as expected. So now I know how to make it work.

Unfortunately CentOS (RHEL) does not support gksu and to make this a further moot point the "clipboard" does not properly copy spreadsheet data between two separate instances of Calc which was the origin of this whole boondoggle.

So again Ygrex my sincere thanks.



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
[SOLVED] Cannot compile gksu in 13.37 TSquaredF Slackware 2 05-05-2011 08:47 PM
How do I install gksu in 12.2 ? tjwoosta Slackware 9 07-28-2009 02:13 AM
gksu with c++ Loser Linux - Software 1 10-23-2008 05:22 PM
gksu or alternative? shame Slackware 4 05-09-2006 04:25 PM
problems with su, gksu nixer4me Debian 1 03-11-2006 04:39 PM > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 11:12 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration