LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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, 10: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-09-2012, 11:26 PM   #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-09-2012, 11:31 PM   #3
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
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-09-2012, 11:44 PM   #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, 12:32 AM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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 12:34 AM.
 
Old 06-10-2012, 09: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, 12: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, 01:14 PM   #8
whizje
Member
 
Registered: Sep 2008
Location: The Netherlands
Distribution: Slackware64 current
Posts: 594

Rep: Reputation: 141Reputation: 141
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, 05:22 PM   #9
craigevil
Senior Member
 
Registered: Apr 2005
Location: OZ
Distribution: Debian Sid/RPIOS
Posts: 4,889
Blog Entries: 28

Rep: Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534
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, 08:01 PM   #10
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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, 11:28 AM   #11
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Salix
Posts: 6,149

Rep: Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314
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, 08:40 PM   #12
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,382
Blog Entries: 28

Rep: Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164
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, 09:53 PM   #13
Teufel
Member
 
Registered: Apr 2012
Distribution: Gentoo
Posts: 616

Rep: Reputation: 142Reputation: 142
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:	295
Size:	83.7 KB
ID:	9916  

Last edited by Teufel; 06-18-2012 at 09:55 PM.
 
Old 06-18-2012, 11:56 PM   #14
mark_alfred
Senior Member
 
Registered: Jul 2003
Location: Toronto, Ontario, Canada
Distribution: Ubuntu Linux 16.04, Debian 10, LineageOS 14.1
Posts: 1,572

Rep: Reputation: 210Reputation: 210Reputation: 210
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:	199
Size:	14.6 KB
ID:	9917  
 
Old 06-19-2012, 01:21 AM   #15
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,627

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
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



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 12:14 AM
Run GUI Program without Desktop slacky Debian 4 02-06-2007 06:35 PM
How to run GUI program as root shadkong Slackware 8 09-20-2005 02:24 PM
Can't run gui applications as root vdogvictor Linux - General 26 08-19-2004 08:24 PM
Run a program from the GUI k.03 Linux - Newbie 3 04-09-2003 08:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:14 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
Open Source Consulting | Domain Registration