LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 06-09-2012, 11:26 PM   #1
paveway
LQ Newbie
 
Registered: Jun 2012
Posts: 4

Rep: Reputation: Disabled
How do I run a gui program as root?


I'm trying to enable samba but the program is all grayed out when I run it. I assume its cause I'm not logged in as root. How do I run it as root? I'm using Debian and I can't actually log in as root.
 
Old 06-10-2012, 12:26 AM   #2
mannmaniyar
LQ Newbie
 
Registered: Apr 2009
Posts: 22

Rep: Reputation: 0
Hi,

If you know root password then you can switch to root using "su -" else try to use sudo <command> from the same user.
 
Old 06-10-2012, 12:31 AM   #3
AwesomeMachine
Senior Member
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora
Posts: 1,829

Rep: Reputation: 257Reputation: 257Reputation: 257
You have to type the name of the program into a virtual terminal with root privileges, see mannmaniyar above. Most programs are in /bin, /usr/bin, /sbin, /usr/sbin. If you don't know the actual command name, put the icon on the desktop, right click the icon, click properties, and click executable
 
Old 06-10-2012, 12:44 AM   #4
paveway
LQ Newbie
 
Registered: Jun 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
for some reason it is not allowing me to drag these samba configuration programs to the desktop. i have no idea why...
 
Old 06-10-2012, 01:32 AM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
Quote:
Originally Posted by paveway View Post
I'm trying to enable samba but the program is all grayed out when I run it. I assume its cause I'm not logged in as root. How do I run it as root? I'm using Debian and I can't actually log in as root.
What program? Which distro are you using?

To launch a gui program as root, use "kdesu" in KDE, or gnomesu in Gnome. This will also allow root access to your screen. However, admin programs launched from the menu will prompt you for the root password so this may not be necessary.

Are you trying to configure samba or have the service enabled?

Last edited by jschiwal; 06-10-2012 at 01:34 AM.
 
Old 06-10-2012, 10:03 AM   #6
bsat
Member
 
Registered: Feb 2009
Posts: 347

Rep: Reputation: 72
you can use "sudo -i" to become root.
 
Old 06-10-2012, 01:47 PM   #7
paveway
LQ Newbie
 
Registered: Jun 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
The program just says Samba - KDE Control Module. I am using Debian.

where do I run kdesu? I tried it in a terminal and got command not found.
 
Old 06-10-2012, 02:14 PM   #8
whizje
Member
 
Registered: Sep 2008
Location: The Netherlands
Distribution: Slackware64 current
Posts: 592

Rep: Reputation: 140Reputation: 140
From Alien Bob in Slackware don't no about Debian
Code:
echo $DISPLAY                  # you'll be needing this value 3 lines below
sudo -i                        # or "su -" on older Slackwares
xauth merge ~alien/.Xauthority # use your own username here instead of "alien"
export DISPLAY=:0.0            # use the value of DISPLAY you've seen 3 lines before

Alternatively, you can run the following two commands which will give you the same end result:

sudo -s                        # a side effect of '-s' is that it allows root to run X programs
. /etc/profile                 # sourcing the global profile ensures
                               # that root has the ''sbin'' directories in the $PATH
 
Old 06-10-2012, 06:22 PM   #9
craigevil
Senior Member
 
Registered: Apr 2005
Location: OZ
Distribution: Debian Sid
Posts: 4,734
Blog Entries: 12

Rep: Reputation: 461Reputation: 461Reputation: 461Reputation: 461Reputation: 461
Cool

HOWTO - get kdesu back to normal in KDE4 - http://forums.debian.net/viewtopic.php?f=16&t=40158



This one is actually pretty easy. In a terminal here is what you do:
Anywhere you see ## just after that is instructions you do NOT have to type the text directly AFTER the ## signs,
what you have to type will either be BEFORE the ## on a line or the line will have NO ## signs.


Code:
   ##first type in:
    su

    ##after you hit enter you will see
    Password:         ##<----------- type in your root password here.

    ##Now you will see your prompt change from a $ to a # sign

    ##Don't worry, almost done now...

    ##type:

    ln -s /usr/lib/kde4/libexec/kdesu /usr/bin/kdesu

    ##hit enter, then type:
    exit

    ##You are now back to your regular user in your terminal. Lets test that puppy out!

    kdesu dolphin

    ##The normal kdesu dialog should pop up asking for roots password with the explanation that the program 
    ##dolphin needs root permissions. You can just cancel the dialog box since it was only a test to see if the link
    ##worked.
as for samba, install and use smb4k.
 
Old 06-17-2012, 09:01 PM   #10
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
You can press ALT-F2 and then enter "kdesu <program name>". If that doesn't work in other distros, I wasn't aware of it.
kdesu & gnomesu differ from sudo in that it handles xauth cookies so that the root user has access to the display. A GUI program needs that.
 
Old 06-18-2012, 12:28 PM   #11
DavidMcCann
Senior Member
 
Registered: Jul 2006
Location: London
Distribution: CentOS, Salix
Posts: 4,158

Rep: Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223
If you search the internet for "debian samba" you may find something useful. I know nothing about the program, but this looks a good place to start:
http://www.debianhelp.co.uk/samba
 
Old 06-18-2012, 09:40 PM   #12
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mint, OpenBSD
Posts: 11,333
Blog Entries: 12

Rep: Reputation: 2729Reputation: 2729Reputation: 2729Reputation: 2729Reputation: 2729Reputation: 2729Reputation: 2729Reputation: 2729Reputation: 2729Reputation: 2729Reputation: 2729
Configuring Samba can be done quite easily though the command line and a text editor. The text editor is used to edit /etc/samba/smb.conf and the command line to add names to the /etc/smbpasswd file.

I recommend Samba by Example: http://samba.org/samba/docs/man/Samba-Guide/

In case it helps, here is a bit of my smb.conf file, which basically allows read/write access.

Code:
[global]
workgroup = workgroup
security = share
encrypt password = yes
smb passwd file = /etc/samba/smbpasswd
show add printer wizard = No
wins support = no

[sharefiles]
path = /home/[username]/[some directory]
guest ok = yes
read only = no
available = yes
browsable = yes
public = yes
writable = yes
Remember that, in addition to configuring Samba, the directories you wish to share must also have their file permissions set to allow sharing; you can do this by going the directories and setting the properties in your file manager.
 
Old 06-18-2012, 10:53 PM   #13
Teufel
Member
 
Registered: Apr 2012
Distribution: Gentoo
Posts: 510

Rep: Reputation: 120Reputation: 120
Quote:
Originally Posted by paveway View Post
where do I run kdesu? I tried it in a terminal and got command not found.
You can get a kdesu command as discribed at post #9
Also you can add some tools to KDE Menu to run them as root.
No need to launch everytime konsole and no need to type a bunch of letters
Just click menu item:
Attached Thumbnails
Click image for larger version

Name:	snapshot6.png
Views:	71
Size:	83.7 KB
ID:	9916  

Last edited by Teufel; 06-18-2012 at 10:55 PM.
 
Old 06-19-2012, 12:56 AM   #14
mark_alfred
Senior Member
 
Registered: Jul 2003
Location: Toronto, Ontario, Canada
Distribution: Ubuntu Linux 16.04
Posts: 1,258

Rep: Reputation: 147Reputation: 147
Rather than kdesu, try using gksu. Since Debian generally runs Gnome, it's likely that it has gksu. gksu is a command launcher for running programs as root. If gksu is not installed on your system, then simply install it (IE, "apt-get install gksu"), and then you can use it. Just press Alt-F2, enter "gksu", and then within the gksu launcher, enter the name of the program you wish to run as root.
Attached Thumbnails
Click image for larger version

Name:	gksu.png
Views:	38
Size:	14.6 KB
ID:	9917  
 
Old 06-19-2012, 02:21 AM   #15
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,817

Rep: Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408
Quote:
for some reason it is not allowing me to drag these samba configuration programs to the desktop. i have no idea why...
because you do not
kde and Gmone3 both block things being " just put" on the desktop

clean desktops IS the rule now

the desktop folder is NOT a general purpose "work bench folder"
 
  


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
how can i run a java program with root privilages from a non-root account? joyjjs Linux - Software 1 08-04-2009 01:14 AM
Run GUI Program without Desktop slacky Debian 4 02-06-2007 07:35 PM
How to run GUI program as root shadkong Slackware 8 09-20-2005 03:24 PM
Can't run gui applications as root vdogvictor Linux - General 26 08-19-2004 09:24 PM
Run a program from the GUI k.03 Linux - Newbie 3 04-09-2003 09:44 AM


All times are GMT -5. The time now is 11:46 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