Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Desktop
User Name
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.


  Search this Thread
Old 10-16-2009, 10:15 AM   #1
LQ Newbie
Registered: Jun 2008
Distribution: Ubuntu (Fluxbox)
Posts: 28

Rep: Reputation: 16
Cant execute commands that is in sbin/ with normal user.

Hi all

I will start with how I believed my problem started. I have directory where I am building my custom linux. So i chrooted into this directory, I cant run X applications in this directory so I tried using sux to run a program.
My command line looked like this : root@dirk:#
Where dirk is my username. When I ran this command, It didnt work and I got some error saying something about my ~/.Xauthority file. I think from there on my system has been having this problem that my normal user cant execute commands in /sbin. For example:
dirk@dirkPC:~$ reboot
Command 'reboot' is available in '/sbin/reboot'
The command could not be located because '/sbin' is not included in the PATH environment variable.
This is most likely caused by the lack of administrative priviledges associated with your user account.
bash: reboot: command not found
What have I tried:
I have checked that my /etc/environment file has the correct path.
I used chown to change ownership of ~/.Xauthority to root.
I have added dirk in visudo with same privileges as the root.
My file is /etc/passwd looks normal.
I have deleted and backed up .Xauthority. The system made a new one with me as owner with RW access.

When i restart my computer the ~/.Xauthority file ownserhip belongs again to dirk and not root. How do I save the .Xauthority settings?
What should the permission of the .Xauthority file be ? and group ?

Things I have noticed that is different. NFS fails to load when computer starts up, alsaplayer does not remember volume settings (because its also in /sbin i presume). And My X display takes longer to load.

Any help would be appreciated.

Last edited by tERn; 10-16-2009 at 10:49 AM. Reason: adding
Old 10-16-2009, 11:18 AM   #2
LQ Newbie
Registered: Jun 2008
Distribution: Ubuntu (Fluxbox)
Posts: 28

Original Poster
Rep: Reputation: 16
Hi all.

I think I know the root of the problem. My path does not get set when the system starts up although the file in /etc/environment is correct. Somehow it is not being executed? I dont know. But when I do
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
. Then everything works. That is the same path that is in my /etc/environment file. So i made a file ~/.bash_profile and added the PATH export. I want to know if there is a better fix to my problem.


sbin, xauthority

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
Root execute command as a normal user carlosjf Linux - Newbie 5 04-01-2011 06:41 PM
why can't i execute shutdown as a normal user? cryincold Debian 14 09-02-2007 03:38 PM
Running super user commands as normal user mickyg Linux - Security 5 10-14-2005 07:25 PM
how to execute firewall script as normal user robthebob Linux - Security 5 01-11-2005 04:36 PM
normal user can't execute files in cd..? doublefailure Linux - Hardware 0 09-11-2002 01:04 AM > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 02:50 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration