MandrivaThis Forum is for the discussion of Mandriva (Mandrake) Linux.
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.
This query is actually in relation to PCLinuxOS, but since it's based on Mandriva and there's no PCLOS sub-forum yet....
I've just done a complete reinstallation, after having been told elsewhere that I was nuts for browsing the web in root mode. The problem was so many applications are by default off-limits to ordinary users and it was just a quick and dirty shortcut to log in as root instead. But anyway, I've put that bad habit behind me. Now, where do I find the settings to give a regular user access to applications? I've never come across a distro with so many readily available configuration options it really is quite baffling. This is the latest release, PCLinuxOS 2009.1
Last edited by Completely Clueless; 04-09-2009 at 10:12 AM.
If I want / need to adjust permissions for executable files here (Mandriva 2009.0 w. KDE-4.2.2) I open a terminal window as root, run konqueror (konqueror -profile "File Management") as a file manager, navigate to the applications I want to adjust, and fix the permissions manually.
This can be a long and tedious process if done on many files (one at a time), so if you want to fix the permissions for all applications in (for example) /usr/bin, you would be best served to open a terminal window (as root), then run the following command (Note:I have not tried this myself):
chmod +x /usr/bin/*
Note: After running this command, check that file permissions have changed to allow all users to execute the files:
FIle permissions are reported in three sets - user, group, world. If a file is writable by the user, readable and executable by the group and the world, its permissions would be reported as:
Sorry but neither the original question or the answer make sense to me. By default on any Linux distro* an ordinary user has execute permissions on all programs in /usr/bin and /bin and almost all in the root-only commands directories /usr/sbin and /sbin. Edit: And just because a user has permission to execute a program doesn't mean the program will function right - most of the root-only commands will just error-out as they can't perform without being root.
*However* All the applications (web browser, office program, media player, games etc.) that a user needs to use can be run without root - it's not like Windows where programs often need to write to system directories like \Windows and \Program Files, any configuration changes or files created will be saved in the user's home directory, where they belong.
The few applications you'd ever need to run as root would be the Control Centre (which will prompt for the root password on startup), a text editor to edit config files or a file manager:
kwrite # start a text editor
konqueror # start a file manager
(although only edit system config files or manager files as root if you know what you're doing)
* Unless PCLinuxOS has changed something fundamental
I am sorry if I confused any one. I was using /usr/bin for an example. All the files in that directory should (of course) be executable by all users. The terminal example was more for completeness than any thing. I should have added that the thread originator should look at man chmod for more information on its use.
Ok but the main point is still that changing the permissions is useless. Either an application or command is designed to be run as a non-privileged user (web browsers, office programs, media players, graphics editors etc. etc.) and should be run non-privileged; or it's a system administration function (Control Centre, editing config files, some commands) and should be run as root either with su - or sudo. The permissions are already setup and shouldn't be changed.
I have re-read your original inquiry, and there is a way you can run applications as root without logging in as the root user (well, as with all things Linux, there are actually a few ways). Open a terminal window, su to root, then execute the application from the root command line. If the program is a GUI application, a window will open, and the program will run with root authority. For most applications that require root authority, you should get a dialogue box requesting that you enter your root password when you start them. For a program such as KDE's System Settings application which is used to configure your user Desktop configurations (should be run with your user authority) as well as KDM (has to be run with root authority), you may want to edit the KDE menu to add a second entry, but with the Run as a different user check box in the Advanced tab checked, and root entered in the username text entry field. To run the KDE menu editor, ALT+Click the KDE Menu, then select Menu Editor in the resulting pop up list.
su with a dash loads root's $PATH environment variable. You could add /sbin to your user's $PATH if that's the only problem, or you could setuid root the executable but that's not usually recommended for security reasons.
Hi, I have another way to get around permissions for frequently used admin programs.
In stead of bash, I use zsh shell, where I can configure alias commands...like,
urpmi the alias = sudo urpmi --noclean
alias cat='sudo cat'
alias locate='sudo locate'
alias lsusb -v='sudo lsusb -v'
alias lsusb='sudo lsusb'
alias lsmod='sudo lsmod'
alias lspci -v='sudo lspci -v'
alias lspci='sudo lspci'
alias fw-reset='sudo fw-reset'
alias service='sudo service'
alias netstat='sudo netstat'
alias fslint='sudo ~/bin/fslint'
alias smart='sudo smart'
alias ifup='sudo ifup'
alias ifdown='sudo ifdown'
alias ifconfig='sudo ifconfig'
alias updatedb='sudo updatedb'
alias rpm='sudo rpm'
alias urpmi.update='sudo urpmi.update'
alias urpmi='sudo urpmi --noclean'
alias urpme='sudo urpme'
to name a few...
Using this method you also need to setup sudo and then "make the user a member of the wheel group".
sample sudoers file...
# Sample /etc/sudoers file.
# This file MUST be edited with the 'visudo' command as root.
# See the sudoers man page for the details on how to write a sudoers file.
# root and users in group wheel can run anything on any machine as any user
root ALL = (ALL) ALL
%wheel ALL = (ALL) ALL
# full time sysadmins can run anything on any machine without a password
FULLTIMERS ALL = NOPASSWD: ALL
# part time sysadmins may run anything but need a password
PARTTIMERS ALL = ALL
..............................................edit for space, see /etc/sudoers "carefullly!"
# users in the WEBMASTERS User_Alias (will, wendy, and wim)
# may run any command as user www (which owns the web pages)
# or simply su to www.
WEBMASTERS www = (www) ALL, (root) /usr/bin/su www
# anyone can mount/unmount a cd-rom on the machines in the CDROM alias
ALL CDROM = NOPASSWD: /sbin/umount /CDROM,\
/sbin/mount -o nosuid\,nodev /dev/cd0a /CDROM
Last edited by GlennsPref; 05-01-2009 at 12:57 AM.
Reason: sorry for being the ambulance man