Aug 10, 2016

Gksudo running graphical commands as root

Gksudo running graphical commands as root on Ubuntu. Gksudo is a frontend to sudo to start graphical applications (edit and modify) as root, For example to edit the configuration file using Gedit graphical text editor remommded to use gksudo gedit /etc/default/sourcesfile instead of sudo gedit /etc/default/sourcesfile
gksudo nautilus
Why using gksudo is recommended then sudo in this case?. see explanation here
You should never use normal sudo to start graphical applications as root. You should use gksudo (kdesudo on Kubuntu) to run such programs.
Run graphical applications as root with sudo, they may save their configuration files in home directory and these files may be owned by root and this causes inaccessible when you're not running as root.

Installation & Use
Gksu not installed by default to use gksudo command install gksu first using this command:
sudo apt-get install gksu
As mention above gksudo running graphical commands as root on Ubuntu (gnome), In other time while we want to install new Ubuntu themes we need to copy appropriate theme's folder in user/share/themes directory or create .themes folder on home directory, we can use gksudo nautilus to open folder as root and install appropriate theme easily.

Anothers example using gksudo gedit implemented on other post Fix and remove notification "system program problem detected" on Ubuntu, Where these sudo and gksudo commands are used. More information about Graphical sudo can be found on Ubuntu help page here.


We are only a handful of Linux users who want to share

Enter your email address:


Useful Source

Getting started with Ubuntu Linux from Infinite Skills.
Learning Ubuntu Linux. A Training Video From Infinite Skills

Learning Linux MInt with GUI and command line tips.
A step-by-step introduction to one of the most popular Linux distributions available with GUI and command line tips.

Recent post