LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-01-2012, 01:12 PM   #1
leofelipe222
LQ Newbie
 
Registered: May 2010
Posts: 3

Rep: Reputation: 0
Non-root account unable to mount a NFS connection


Does anyone know if it's possible to mount a NFS connection if not using a root account but non-root? My server is running CentOS 5.4.

I tried and here's what I get:
'mount: only root can do that'

Please help!!! Someone told me that it's possible...
 
Old 02-01-2012, 02:03 PM   #2
rustek
Member
 
Registered: Jan 2010
Location: Melbourne, IA, USA
Distribution: Ubuntu
Posts: 93

Rep: Reputation: 8
If the nonroot account can use sudo then "sudo mount whatever".

If you don't want the user to be admin but still want them to use mount then add a line for them in sudoers.

visudo
Code:
username ALL=(root) NOPASSWD: /bin/mount
This will allow username to sudo mount whatever.
 
1 members found this post helpful.
Old 02-01-2012, 02:16 PM   #3
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

Hi leofelipe222,

Yes, it is possible. However, non-root users can only mount the shares defined in /etc/fstab. You have to set something like this in /etc/fstab file of the server on which you want normal users to mount nfs share:

Code:
nfs-server01:/export       /media                  nfs      noauto,user    0 0
And then mount it using the following command:

Code:
mount /media
You can definitely go with sudo approach but that will be like giving too much access for one nfs share.
 
1 members found this post helpful.
Old 02-01-2012, 03:00 PM   #4
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 244Reputation: 244Reputation: 244
There is also autofs, but for a simple mount point I'd use T3RM1NVT0R suggestion
 
Old 02-01-2012, 03:47 PM   #5
rustek
Member
 
Registered: Jan 2010
Location: Melbourne, IA, USA
Distribution: Ubuntu
Posts: 93

Rep: Reputation: 8
The /etc/fstab answer is better.
My sudo reply would allow them to mount anything not just the share.
 
Old 02-03-2012, 12:34 AM   #6
leofelipe222
LQ Newbie
 
Registered: May 2010
Posts: 3

Original Poster
Rep: Reputation: 0
Adding the information into the client's /etc/fstab was to key to solve this issue. Thanks guys...

No more blah blah from users
 
Old 02-03-2012, 02:02 PM   #7
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

Good to hear that it has been sorted. Could you please mark this thread as solved.

Enjoy linux!!!
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
diskless node unable to mount root FS via NFS jwpaine Linux - Server 2 10-11-2011 08:00 PM
Unable to mount root via NFS devaras Linux - Newbie 1 02-23-2010 09:16 PM
VFS: unable to mount root via NFS... gireya Linux From Scratch 0 09-05-2008 06:29 PM
VFS: Unable to mount root fs via NFS, trying floppy aleksanteri Linux From Scratch 0 10-26-2007 12:00 AM
NFS mount over SSH: Unable to receive; errno = Connection refused karlmdv Linux - Server 4 07-04-2007 06:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:52 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
Open Source Consulting | Domain Registration