LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Environment variables and runnning programes as root (http://www.linuxquestions.org/questions/linux-software-2/environment-variables-and-runnning-programes-as-root-172184/)

marghorp 04-19-2004 03:54 PM

Environment variables and runnning programes as root
 
I have just installed dc_qt and I have this silly problem. If I run it as user (not root), it works, but it does not download programes. If I run it as root, it works great. Is it possible that running it as a user it somehow does not get through the firewall, and it does as root?

Can a program be run as root by a user?


One other thing. I keep setting the PATH variable to include /sbin with the command:

export PATH="$PATH:/sbin"

Can this be made permanent? I don't want to do it every time I reboot my computer.

Thanks!

Komakino 04-19-2004 03:57 PM

You can let a user run a program as root by setting the program's suid bit using chmod:
Code:

chmod +s program
will allow any user to run it, but it will be run as if root was running it.

You can make export PATH="$PATH:/sbin" permenant by adding it to your .bashrc file (a hidden file in your home directory) - or add it to /etc/profile

marghorp 04-19-2004 05:34 PM

thanks! you really helped me. Just what I needed.

One more thing. How do I add path variable to profile in etc? just like in bashrc? or is it some other language?


All times are GMT -5. The time now is 08:16 AM.