LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-08-2019, 08:24 PM   #1
Dain_Bramage
LQ Newbie
 
Registered: Mar 2019
Posts: 28

Rep: Reputation: Disabled
Mount a directory with out needing to input root password


Hi All,

I am trying to figure out a way of mounting and unmounting directories with out needing to input the root password.

I have made the following addition to my sudoers file:

Code:
mike ALL=(root) NOPASSWD:/bin/mount, /bin/umount
but it hasn't worked.

Does anyone know how it can be done?
 
Old 12-08-2019, 09:12 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 15,896
Blog Entries: 27

Rep: Reputation: 4675Reputation: 4675Reputation: 4675Reputation: 4675Reputation: 4675Reputation: 4675Reputation: 4675Reputation: 4675Reputation: 4675Reputation: 4675Reputation: 4675
If this directory is in /etc/fstab, you can edit the relevant entry to specify "user." For example

Code:
UUID=[ some value ]   /media/sdb1       auto,user        0    0
See man fstab for more.

Otherwise, tell us more about this directory (more likely, it's a partition if you have to mount it).
 
1 members found this post helpful.
Old 12-08-2019, 10:14 PM   #3
berndbausch
Senior Member
 
Registered: Nov 2013
Location: Tokyo
Distribution: A few
Posts: 4,150

Rep: Reputation: 1166Reputation: 1166Reputation: 1166Reputation: 1166Reputation: 1166Reputation: 1166Reputation: 1166Reputation: 1166Reputation: 1166
Quote:
Originally Posted by Dain_Bramage View Post
Code:
mike ALL=(root) NOPASSWD:/bin/mount, /bin/umount
Perhaps you need a space after the colon.
 
Old 12-09-2019, 03:02 AM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 13,422
Blog Entries: 9

Rep: Reputation: 3668Reputation: 3668Reputation: 3668Reputation: 3668Reputation: 3668Reputation: 3668Reputation: 3668Reputation: 3668Reputation: 3668Reputation: 3668Reputation: 3668
Mount a directory?

Be that as it may, policykit might be more elegant for this. It's what DEs use for this sort of stuff.+
 
  


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
Cant figure out how to boot Linux mint(rosa), needing help johnnyboynewbie Linux - Newbie 9 03-07-2016 07:46 PM
having a couple minor glitches needing working out frieza Linux From Scratch 21 09-17-2010 12:14 AM
[SOLVED] running out of disk space and needing to transplant /home directories unclejed613 Slackware 11 11-06-2009 12:05 AM
Repeated "input: AT Translated Set 2 keyboard as /class/input/input" messages AcerKev Mandriva 2 09-16-2007 09:35 AM
Needing a password for ksysguard wswartz Linux - General 1 02-16-2006 06:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:31 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration