LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 08-29-2009, 10:09 AM   #1
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Rep: Reputation: 57
How to increase the security of NFS kernel server?


Hello I followed this how to to make a NFS server:

http://ubuntuforums.org/showthread.php?t=249889

so it means: exports looks like this:
Quote:
sudo vi /etc/exports

Here are some quick examples of what you could add to your /etc/exports

For Full Read Write Permissions allowing any computer from 192.168.1.1 through 192.168.1.255

* /files 192.168.1.0/24(rw,no_root_squash,async)

it means that if sbdy arrives with a linux machine, puts the ethernet cable into the router, then logs as root on his machine, and mount the exports. He can do almost everythg, with permissions chmod'ing ...

is that LAMP, or i am wrong for nfs kernel servers, the ultimate users/password servers against that to prevent those physical approches /logins?is there good how to ?
 
Old 08-30-2009, 12:21 PM   #2
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
Moved: This thread is more suitable in <Security> and has been moved accordingly to help your thread/question get the exposure it deserves.

Sasha
 
Old 08-31-2009, 12:17 AM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,356

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
no_root_squash would be very unusual, I'd recommend root_squash (the default iirc).
That leading '*' looks wrong too; usually you start with the dir to be exported (this is on the server) then space, then network or ip to export to, then options in parentheses.
See http://www.linuxtopia.org/online_boo...g-exports.html
 
Old 08-31-2009, 12:42 PM   #4
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Original Poster
Rep: Reputation: 57
Quote:
Originally Posted by chrism01 View Post
no_root_squash would be very unusual, I'd recommend root_squash (the default iirc).
That leading '*' looks wrong too; usually you start with the dir to be exported (this is on the server) then space, then network or ip to export to, then options in parentheses.
See http://www.linuxtopia.org/online_boo...g-exports.html
wow cool, an expert!

I think that I found this configuration on the board of ubuntu forum or wiki hmmm
I study your link, and come back with my progresses. Certainly on thursday.

I was thinking, about possible security hole, if it is the case.
So, let's take the example. One has an informatic linux ssh debian lenny server daemon running (simply, SSH). By default, you have the port tunneling possible, which means port 2049 for nfs sharing. The guy logins (or the woman, because there is too women that have linux. Well, I dont know any but ok, let's imagine) to your machine, running ssh daemon, with the very famous putty. This bright head, endlessly curiously gready for experimenting and discovering new things, forward with tunneling the ssh connection, using putty. He (or she) figures out to try mount, with an external machine ; let's call it Leathal-Intruder.
Unfortunately, the basic linux admin. newbie is not capable to have a Lamp server with a main and unique login/passwd for samba and nfs, and whatever exists for sharing. Since it's his own machine, he has the root pwd. (he, the Lethal-Intruder ; or actually, both, because they are admins. Well, he could be a she, or both...) That's because it can be a bit complicated, and those shall require time and bit of practice with Linux. So, this sort of mini hacker, as called Lethal-Intruder, has his tunneling to the nfs 2049, which is open. The admin command "su", ran from the intruder, followed by a "mount", gets the same exposure as a machine on the network. He mounts with root#, done. I am sure I have it wrong, and it exists security about it in Linux. But let's bet you a bier, how many have such security with their nfs? I bet you that 70 percent of Linuxers (let's call it like that ; btw is there a name? ) have a nfs configured without those security "abilities"

Frenchn00b
--
erratatus:
LAMP should and shall be read :
"LDAP"
http://www.plug.org/pipermail/plug/2007-May/026339.html

Last edited by frenchn00b; 08-31-2009 at 01:16 PM.
 
Old 08-31-2009, 01:54 PM   #5
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
Use kerberos with NFS, or use something besides NFS.
 
Old 08-31-2009, 07:55 PM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,356

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Like I said, I'm pretty sure root_squash is the default at install. Most people would probably leave it at that, in fact I'm sure I've seen qns at LQ where its been discussed.
There are various ways you can tighten down NFS. That link shows you how to lock down the other ports used by the helper tools (eg mount, lock, portmap etc).
Note also that in nfsv4, all that functionality has been encapsulated in the nfs server sw, so only one daemon (nfs) is reqd,
See also tcp_wrappers & iptables.
 
  


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
2.6.26 Kernel NFS locking problem with an old 2.2 Kernel NSF server PeteRossi Linux - Kernel 3 08-03-2008 02:34 AM
NFS server security jkmreyes Linux - Server 1 03-12-2008 10:24 PM
LXer: Seven steps to increase Linux security LXer Syndicated Linux News 0 10-16-2006 02:54 PM
Will a new router increase security- hardware firewall? M$ISBS Linux - Security 4 05-20-2006 07:24 PM
increase security jpc82 Linux - Security 2 04-25-2002 03:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 03:25 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