# gksu & permissions



## sk8harddiefast (Jul 3, 2010)

I hope this is the right forum to ask
I have a little issue. A lot of my programs need root access to open like evolution mail etc.
I open them from terminal without any problem.
But i have fluxbox & i want to open them from my menu.
So i installed gksu.
On my menu on command section, i said gksu evolution.
Gksu opens asking password. I set password but is not opening evolution.
I run gksuexec and i set deadreamer as root with the same result.
Also gksu from terminal open only with sudo.
Seems like gksu is not running because himself wants root access to run!
Any ideas?


----------



## FrogLS (Jul 3, 2010)

sk8harddiefast said:
			
		

> I hope this is the right forum to ask
> I have a little issue. A lot of my programs need root access to open like evolution mail etc.



You need root privileges to execute evolution? How so?



> Gksu opens asking password. I set password but is not opening evolution.
> ...
> Also gksu from terminal open only with sudo.




If using gksu you need to specify an user or else root is su'ed.

`$ gksu -u deadreamer evolution`

or simply use gksudo. More info in man gksu.

What command works best for you in the terminal, the line executing gksu in the
configuration file for the fluxbox menu needs to be adapted accordingly.


----------



## sk8harddiefast (Jul 3, 2010)

Evolution, virtualbox, nvclock & some others.



> $ gksu -u deadreamer evolution


I did it and now is not responding at gksu -u & gksudo.
Just do nothing!


----------



## teckk (Jul 3, 2010)

> A lot of my programs need root access to open like evolution mail etc.


You should not be opening apps that access the internet as root. If they won't open as user then look into a permissions problem.

Do you have xterm or aterm installed? Do you have sudo configured? /usr/local/etc/sudoer

/usr/home/username/.fluxbox/menu

```
[exec] (Rox as Root) {xterm -bg red -fg white -g 30x10 -e sudo rox -n}
```
That will open a small xterm, ask you your password, then open rox as root.


```
[exec] (TCPdump) {xterm -bg black -fg white -sb -g 120x50 -e sudo tcpdump -q -t -i dc0}
```
That will open xterm large, open tcpdump with -q -t -i


```
[exec] (Top) {xterm -T TOP -g 80x53 -bg black -fg white -e sudo top}
```
That will open xterm large, ask for password, then open top as root so you can kill whatever if you want.


```
[exec] (Sleep) {xterm -T Sleep -g 40x10 -bg yellow -e sudo acpiconf -s3}
```
That opens a small xterm, ask for password, puts machine asleep.


```
[exec] (Network Down) {xterm -T Network_Down -g 40x10 -bg blue -fg white -e sudo ifconfig dc0 down}
```
That will take the ethernet down.

You get the idea. Use your own parameters


----------



## sk8harddiefast (Jul 3, 2010)

```
[exec] (Rox as Root) {xterm -bg red -fg white -g 30x10 -e sudo rox -n}
```
Terminal open asked for password. I set password and terminal show this:

```
(evolution:61385): e-data-server-DEBUG: Loading categories from "/root/.evolution/categories.xml"
(evolution:61385): e-data-server-DEBUG: Loaded 31 categories
```
After terminal closed but evolution not show up!
Also i like this way better than gksu so i am thinking to remove gksu.Password:
But the problem seems not to be gksu but my permissions.
Well the truth is that always i had the problem with permissions. I don't know to set them right 
this is my sudoers file

```
=====line 1 col 0 lines from top 1 ============================================
# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
# Failure to use 'visudo' may result in syntax or file permission errors
# that prevent sudo from running.
#
# See the sudoers man page for the details on how to write a sudoers file.
#

# Host alias specification

# User alias specification

# Cmnd alias specification

# Defaults specification
# Uncomment if needed to preserve environmental variables related to the
# FreeBSD pkg_* utilities and fetch.
#Defaults       env_keep += "PKG_PATH PKG_DBDIR PKG_TMPDIR TMPDIR PACKAGEROOT PA

# Additionally uncomment if needed to preserve environmental variables
# related to portupgrade.
#Defaults       env_keep += "PORTSDIR PORTS_INDEX PORTS_DBDIR PACKAGES PKGTOOLS_

# Runas alias specification

# User privilege specification
root    ALL=(ALL) ALL
deadreamer ALL=(ALL) ALL

# Uncomment to allow people in group wheel to run all commands
%wheel  ALL=(ALL) ALL

# Same thing without a password
# %wheel        ALL=(ALL) NOPASSWD: ALL

# Samples
%users  ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
%users  localhost=/sbin/shutdown -h now
%users  localhost=/usr/sbin/portsnap
```


----------



## teckk (Jul 3, 2010)

> Terminal open asked for password. I set password. After terminal closed but evolution not show up!


You should not be running a mail client as root. Run it as user. If it won't open as user then check for permission problem on evolution itself. Does firefox, xterm, etc. work as user? Or does everything require root perm to open?


```
# User privilege specification
root    ALL=(ALL) ALL
deadreamer ALL=(ALL) ALL

# Uncomment to allow people in group wheel to run all commands
%wheel  ALL=(ALL) ALL
```
That should allow anyone on the box to do anything


----------



## sk8harddiefast (Jul 3, 2010)

```
You should not be running a mail client as root. Run it as user.
```
Well you have absolutely right. The problem is that is not doing it 
Also evolution today is dead!

```
sudo evolution
(evolution:61462): e-data-server-DEBUG: Loading categories from "/root/.evolution/categories.xml"
(evolution:61462): e-data-server-DEBUG: Loaded 31 categories

(evolution:61462): Unique-DBus-WARNING **: Error while sending message: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
```



> Does firefox, xterm, etc. work as user?


Yeap. Opera, urxvt and a lot of my programs run as user but some of them i need to run them as root because cannot save the changes. For example gimp work as user. I create something but is impossible to save it anywhere. So i am openning it as root to do my job


----------



## FrogLS (Jul 3, 2010)

sk8harddiefast said:
			
		

> Evolution, virtualbox, nvclock & some others.



Please read ÎŸ Î›Î¿Î³Î±ÏÎ¹Î±ÏƒÎ¼ÏŒÏ‚ Î¥Ï€ÎµÏÏ‡ÏÎ®ÏƒÏ„Î·.



> Well the truth is that always i had the problem with permissions.



If you are interested:

Î†Î´ÎµÎ¹ÎµÏ‚ (Permissions) and more:

Î•Î³Ï‡ÎµÎ¹ÏÎ¯Î´Î¹Î¿ Ï„Î¿Ï… FreeBSD

Î£Ï…Ï‡Î½Î­Ï‚ Î•ÏÏ‰Ï„Î®ÏƒÎµÎ¹Ï‚ Î³Î¹Î± Ï„Î¿ FreeBSD


----------



## sk8harddiefast (Jul 3, 2010)

urxvt -e sudo works fine 
Just because evolution it is not working , is not responding. But i am rebuilding evolution again now.
Now this is my last problem.


> Yeap. Opera, urxvt and a lot of my programs run as user but some of them i need to run them as root because cannot save the changes. For example gimp work as user. I create something but is impossible to save it anywhere. So i am openning it as root to do my job


----------



## teckk (Jul 3, 2010)

```
sudo evolution
....../root/.evolution/categories.xml
```
Do NOT run evolution as root.

/home/user/.evolution
Does user own that directory and everything in it? If not use chown and make user owner. All sub directories.

In fact does user own all of the hidden files in /usr/home/you/*
Those are config files for your apps opened as user. If you open them as root, root has it's own config directory.

Open a terminal and enter as user.

```
evolution
```
post the output. Or at least the last few lines before failure to open.


----------



## sk8harddiefast (Jul 3, 2010)

Never mind. I will remove evolution and i will install thunderbird. Evolution is hudge with up to 50 dependencies and i don't need all them that has.
Thunderbird seems more simple and light.
How to remove evolution and all the 50 dependencies that came with it?


----------



## teckk (Jul 3, 2010)

I use thunderbird and like it. It is evolution like but a little smaller. I used Evolution in the past but it's a little heavy
/usr/ports/mail/thunderbird

Then there are a few smaller lighter but good mail client like sylpheed.

Did you check to see that you are owner of everything in your /usr/home/username
The hidden files are the config files for apps.
I have had apps change owners of ~/.gconf before and it will cause app crashes.

You run a KDE app like K3B as root and it will change ownership of 

/usr/home/username/.Xauthority Then nothing will open as user.
/usr/home/username/.gconf/apps/evolution is where evolution keeps it's configs.
Before you give up on Evolution look at the ownership of everything in your /usr/home/username User should own it all. And all subdirectories.
You'll need to check all the hidden files in /usr/home/


----------



## sk8harddiefast (Jul 3, 2010)

sylpheed seems better 
I have .evolution on my home directory. Also i have all hidden folders on /usr/home/deadreamer & on my home directory.
My home directory and /usr/home/deadreamer are the same.
Chown what exactly do?
In fact i am not give up with evolution because is not running but because is hudge. I hate dependencies very much. Big programs with 100000 stuff too!
I want small simple tools just to do that i want as i want. Evolution has calendar, memos etc? ok. I will never use calendar & memos.
Also if i was knowing that has 50 dependencies, i never install it. Even KDE has less 
How to remove all dependencies that came with evolution?


----------



## teckk (Jul 3, 2010)

```
pkg_info | less
```
scroll down and find your app

```
sudo pkg_delete evolution-2.26.0
```
example, use your own parameters

Before you uninstall it check the ownership of the config files in your ~/. That is probably where the problem is. Get it working. That is how you learn. Then delete the app if you don't want it.

Do you understand what is meant by file and directory ownership? You haven't said if user owns all config files. If root owns them then the app won't launch.

Good luck


----------



## sk8harddiefast (Jul 4, 2010)

chow do the job 
I run 
	
	



```
sudo chown -R deadreamer /home/deadreamer
```
and now i can run all my programs as user and save the "projects" on my home directory.
Also the problem was evolution because gksu works just fine 
Thanks for your help teckk & FrogLs 
I cay say solved now


----------

