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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
06-09-2012, 11:26 PM
|
#1
|
LQ Newbie
Registered: Jun 2012
Posts: 4
Rep:
|
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.
|
|
|
06-10-2012, 12:26 AM
|
#2
|
LQ Newbie
Registered: Apr 2009
Posts: 22
Rep:
|
Hi,
If you know root password then you can switch to root using "su -" else try to use sudo <command> from the same user.
|
|
|
06-10-2012, 12:31 AM
|
#3
|
LQ Guru
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
|
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
|
|
|
06-10-2012, 12:44 AM
|
#4
|
LQ Newbie
Registered: Jun 2012
Posts: 4
Original Poster
Rep:
|
for some reason it is not allowing me to drag these samba configuration programs to the desktop. i have no idea why...
|
|
|
06-10-2012, 01:32 AM
|
#5
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
Quote:
Originally Posted by paveway
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.
|
|
|
06-10-2012, 10:03 AM
|
#6
|
Member
Registered: Feb 2009
Posts: 347
Rep:
|
you can use "sudo -i" to become root.
|
|
|
06-10-2012, 01:47 PM
|
#7
|
LQ Newbie
Registered: Jun 2012
Posts: 4
Original Poster
Rep:
|
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.
|
|
|
06-10-2012, 02:14 PM
|
#8
|
Member
Registered: Sep 2008
Location: The Netherlands
Distribution: Slackware64 current
Posts: 594
Rep:
|
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
|
|
|
06-10-2012, 06:22 PM
|
#9
|
Senior Member
Registered: Apr 2005
Location: OZ
Distribution: Debian Sid/RPIOS
Posts: 4,909
|
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.
|
|
|
06-17-2012, 09:01 PM
|
#10
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
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.
|
|
|
06-18-2012, 12:28 PM
|
#11
|
LQ Veteran
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Salix
Posts: 6,204
|
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
|
|
|
06-18-2012, 09:40 PM
|
#12
|
LQ Guru
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,734
|
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.
|
|
|
06-18-2012, 10:53 PM
|
#13
|
Member
Registered: Apr 2012
Distribution: Gentoo
Posts: 616
Rep:
|
Quote:
Originally Posted by paveway
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:
Last edited by Teufel; 06-18-2012 at 10:55 PM.
|
|
|
06-19-2012, 12:56 AM
|
#14
|
Senior Member
Registered: Jul 2003
Location: Toronto, Ontario, Canada
Distribution: Ubuntu Linux 16.04, Debian 10, LineageOS 14.1
Posts: 1,573
|
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.
|
|
|
06-19-2012, 02:21 AM
|
#15
|
LQ Muse
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,667
|
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"
|
|
|
All times are GMT -5. The time now is 08:54 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|