LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices

Reply
 
Search this Thread
Old 04-09-2009, 10:10 AM   #1
Completely Clueless
Member
 
Registered: Mar 2008
Location: Marbella, Spain
Distribution: Many and various...
Posts: 779

Rep: Reputation: 67
Question Configuring User Permissions for Applications


Hi Guys,

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

Thanks, cc.

Last edited by Completely Clueless; 04-09-2009 at 10:12 AM.
 
Old 04-09-2009, 12:55 PM   #2
ernie
Senior Member
 
Registered: Nov 2001
Location: Toledo, Ohio - USA
Distribution: Mageia 1
Posts: 1,079
Blog Entries: 4

Rep: Reputation: 70
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):
Code:
chmod +x /usr/bin/*
Note: After running this command, check that file permissions have changed to allow all users to execute the files:
Code:
ls -al
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:
Code:
-rwxr-xr-x 1 root root 20504 2008-09-07 16:29 xscreensaver-command*
HTH,

Last edited by ernie; 04-09-2009 at 01:06 PM.
 
Old 04-16-2009, 04:35 AM   #3
tkedwards
Senior Member
 
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549

Rep: Reputation: 51
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:
Code:
su -
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

Last edited by tkedwards; 04-16-2009 at 04:37 AM.
 
Old 04-16-2009, 03:28 PM   #4
ernie
Senior Member
 
Registered: Nov 2001
Location: Toledo, Ohio - USA
Distribution: Mageia 1
Posts: 1,079
Blog Entries: 4

Rep: Reputation: 70
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.
 
Old 04-16-2009, 03:38 PM   #5
tkedwards
Senior Member
 
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549

Rep: Reputation: 51
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.
 
Old 04-17-2009, 01:30 AM   #6
ernie
Senior Member
 
Registered: Nov 2001
Location: Toledo, Ohio - USA
Distribution: Mageia 1
Posts: 1,079
Blog Entries: 4

Rep: Reputation: 70
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.

HTH,
 
Old 04-17-2009, 02:25 AM   #7
tkedwards
Senior Member
 
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549

Rep: Reputation: 51
Quote:
Open a terminal window, su to root, then execute the application from the root command line.
This won't work on most setups, it needs to be
Code:
su -
and I already posted this 4 posts ago!
 
Old 04-17-2009, 05:22 AM   #8
ernie
Senior Member
 
Registered: Nov 2001
Location: Toledo, Ohio - USA
Distribution: Mageia 1
Posts: 1,079
Blog Entries: 4

Rep: Reputation: 70
tksedwards,
Since I am so stupid that I did not see your earlier post (where you "already said that 4 posts ago"), I'll remove myself from the equation so as to not further confuse the issue.
 
Old 04-17-2009, 05:33 AM   #9
tkedwards
Senior Member
 
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549

Rep: Reputation: 51
Why get offended? It's the most basic common sense on msg boards to read the thread before you reply, as it's annoying for others when you don't.
 
Old 04-21-2009, 10:33 PM   #10
Crito
Senior Member
 
Registered: Nov 2003
Location: Knoxville, TN
Distribution: Kubuntu 9.04
Posts: 1,168

Rep: Reputation: 53
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.
 
Old 05-01-2009, 12:45 AM   #11
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Mageia Studio-13.37 Kubuntu.
Posts: 3,325
Blog Entries: 33

Rep: Reputation: 199Reputation: 199
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

Code:
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...
Quote:
#
# 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.
#

##
# User alias specification
##
User_Alias FULLTIMERS = millert, mikef, dowdy
User_Alias PARTTIMERS = bostley, jwfox, crawl
User_Alias WEBMASTERS = will, wendy, wim


##
# Override built-in defaults
##
Defaults syslog=auth
Defaults>root !set_logname
Defaults:FULLTIMERS !lecture
Defaults:millert !authenticate
Defaults@SERVERS log_year, logfile=/var/log/sudo.log

##
# User specification
##

# 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


cheers, Glenn

Last edited by GlennsPref; 05-01-2009 at 12:57 AM. Reason: sorry for being the ambulance man
 
  


Reply


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
plrblem configuring LTSP server for local applications shishirkotkar Linux - Software 0 04-14-2008 10:36 AM
Configuring permissions for FTP Gantlett Linux - Newbie 2 09-10-2007 07:41 AM
Need help configuring permissions to allow FTP access via SSH/SFTP. dhupke Linux - General 5 06-12-2007 12:26 PM
Giving user 'www-data' same permissions as normal user MikeOfAustin Linux - Software 5 06-08-2007 02:50 AM
Configuring audio, video and device permissions intersidereal Slackware 1 07-02-2004 02:38 PM


All times are GMT -5. The time now is 05:11 PM.

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