Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 03-26-2013, 01:45 AM   #1
Registered: Jul 2011
Posts: 62

Rep: Reputation: Disabled
Many questions NFS

Q1. I tried to configure NFS on client and server and had the following issue.

In Server config file /etc/exports

/var/log client1(rw)

In the client I mounted the file system

#mount -t nfs server:/var/log /mnt

when I try to view the files I am able to view them and read the contents of the file.

When I try to make any changes in the existing file, or create a new file, or delete a existing file, I am getting an error message saying "Only root can do that" or something like "Permission Denied"

Let me know what is wrong here. I mounted the NFS from client as root and accessing the files as a normal user.
Old 03-26-2013, 02:45 AM   #2
Registered: Jan 2007
Location: Alberta Canada
Distribution: Fedora/Redhat/CentOS
Posts: 70

Rep: Reputation: 19
You don't mention the Linux distro you're using, so I cannot say for sure, but most distros set the permissions for /var/log and its contents to the owner and group of root:root. Some files and dirs within /var/log are owned by special users. Like 'cups' for the print scheduler logs, etc, but most, if not all, files cannot be modified by regular users. This is basic security so a non-root user cannot delete/modify lines in log files in an attempt to hide bad behaviour.

Also, many files within /var/log are in a opened state by the running process(es) (OS services) that are writing to them, again, like cups, the print scheduler, holds its log files open, so it can write to them quicker. Modifying a log file that is open by a process can cause problems for the process because it may decide its log file is being tampered with.

Attempting to change the permissions on files in /var/log is a bad idea because processes will either not be able, or will refuse, to write to log files with incorrect permissions.

Unless there are good reasons to have the file you want to modify in /var/log, I suggest creating a directory somewhere else in the file system, and share out that directory. You can set the owner of that directory and its contents to the user that will access the files, and NFS will work for you. Keep in mind that the 'user' must have the same uid on both the client and server. In other words, make sure the entries in /etc/passwd on both systems have the same number in field 3 for your user.

Otherwise, to modify files in /var/log, you will need to add to the line in /etc/exports:
/var/log client1(rw,no_root_squash)
and access files from the client as 'root', but I really cannot recommend this.
Old 03-26-2013, 02:47 AM   #3
Senior Member
Registered: May 2009
Location: WV, USA
Distribution: Xubuntu, Slackware, Amazon Linux
Posts: 1,905
Blog Entries: 20

Rep: Reputation: 126Reputation: 126
You want to disable the "root_squash" option (maps uid 0 to user nobody). Do this in your /etc/exports file:
/var/log client1(rw,no_root_squash)
You now have a security hole and need to make sure you restrict access by IP or host, and make sure no one who is untrusted can run on that LAN.
Old 03-26-2013, 06:07 AM   #4
Registered: Jul 2011
Posts: 62

Original Poster
Rep: Reputation: Disabled
Here is the thing I mounted the /Some/Directoy.
Now I am facing the same issue.
Old 03-26-2013, 06:32 AM   #5
Registered: Jul 2011
Posts: 62

Original Poster
Rep: Reputation: Disabled
What are the daemons nfs will start


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
Several NFS questions shamusfu Linux - Server 5 11-05-2008 01:16 PM
NFS questions methodtwo Linux - Networking 2 05-04-2008 05:30 AM
NFS questions Geminias Linux - Server 2 08-08-2007 09:53 PM
NFS Questions phil1076 Linux - Networking 2 05-03-2004 05:34 PM
A few questions on NFS Thaidog Linux - Networking 4 12-15-2003 03:55 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:17 AM.

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