LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 03-18-2016, 07:10 AM   #1
robertkwild
Member
 
Registered: Feb 2015
Posts: 382

Rep: Reputation: Disabled
add mount command to all users in sudoers file


hi all,

i want to add all users to have the access to use the mount command ie atm when a user trys to use the mount command they get this -

[robw@robw-linux ~]$ mount -t cifs -o username=robertw //molfiler03/Public /mnt/Public/

mount: only root can do that

[robw@robw-linux ~]$

but obviously when i su into root i can mount it no problems

so can i use a variable ie like this in my sudoers file on a new line -

$USER ALL=/sbin/mount /sbin/umount

will this work for all the users on the system

many thanks

rob
 
Old 03-18-2016, 11:58 AM   #2
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
Quote:
Originally Posted by robertkwild View Post
[robw@robw-linux ~]$ mount -t cifs -o username=robertw //molfiler03/Public /mnt/Public/

mount: only root can do that
Your command is wrong. You forgot to use 'sudo' in front of the command.
 
Old 03-18-2016, 01:02 PM   #3
robertkwild
Member
 
Registered: Feb 2015
Posts: 382

Original Poster
Rep: Reputation: Disabled
success!!!

add this to your fstab as root -

//molfiler03/Public /mnt/Public cifs user,username=robertw 0 0

now any user can mount this share by typing this command

mount /mnt/Public/

it will ask for the password for robertw as i havnt included the password paramenter aswell

the special paramenter is user, this means any user can mount this share, but only this share mind you
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Fedora: How can I add myself back to sudoers file? 33volx Linux - Security 3 11-19-2014 12:55 PM
Filtering of Users in Sudoers File Vineeth Zacharia Linux - Newbie 1 11-07-2013 07:19 PM
[SOLVED] How to add a new user in sudoers file? ravisingh1 Linux - Security 7 09-01-2013 05:02 AM
[SOLVED] User not in sudoers: How to add user? Permtion Denied for sudoers file esgol Linux - Newbie 3 07-13-2012 07:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 12:11 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration