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 02-11-2013, 10:31 AM   #1
ssenuta
Member
 
Registered: Mar 2006
Location: NYS
Distribution: Mandriva-2006
Posts: 123

Rep: Reputation: 16
Help NFS TCP Wrapper (host.deny) confusion:


I'm confused over what "NAMES" to use to deny NFS services to clents.
I only do Ad-hoc wireless NFS sharing between two computers & I do
not go thru my internet itpable firewall.

My /etc/hosts.deny looks like this & is based on "rpcinfo" display names:
All:192.168. EXCEPT 192.168.1.1 192.168.1.2

nlockmgr:All EXCEPT 192.168.1.1 192.168.1.2
mountd:All EXCEPT 192.168.1.1 192.168.1.2
rquotad:All EXCEPT 192.168.1.1 192.168.1.2
status:All EXCEPT 192.168.1.1 192.168.1.2

Should it look like this (????):
All:192.168. EXCEPT 192.168.1.1 192.168.1.2

lockd:All EXCEPT 192.168.1.1 192.168.1.2
mountd:All EXCEPT 192.168.1.1 192.168.1.2
rquotad:All EXCEPT 192.168.1.1 192.168.1.2
statd:All EXCEPT 192.168.1.1 192.168.1.2

------OR-------

Should it look like this (????):
All:192.168. EXCEPT 192.168.1.1 192.168.1.2

rpc.lockd:All EXCEPT 192.168.1.1 192.168.1.2
rpc.mountd:All EXCEPT 192.168.1.1 192.168.1.2
rpc.rquotad:All EXCEPT 192.168.1.1 192.168.1.2
rpc.statd:All EXCEPT 192.168.1.1 192.168.1.2

Here is some output data displayed by different console commands:
rpcinfo -s 192.168.1.1 output:
program version(s) netid(s) service owner
100000 2,3,4 local,udp,tcp,udp6,tcp6 portmapper superuser
100003 3,2 udp6,tcp6,udp,tcp nfs superuser
100021 4,3,1 tcp6,udp6,tcp,udp nlockmgr superuser
100005 3,2,1 tcp6,udp6,tcp,udp mountd superuser
100011 2,1 tcp,udp rquotad superuser
100024 1 tcp6,udp6,tcp,udp status 29

ps -e output:
4811 ? 00:00:00 lockd
4812 ? 00:00:00 nfsd
4813 ? 00:00:00 nfsd
4814 ? 00:00:00 nfsd
4815 ? 00:00:00 nfsd
4816 ? 00:00:00 nfsd
4817 ? 00:00:00 nfsd
4818 ? 00:00:00 nfsd
4819 ? 00:00:00 nfsd
4828 ? 00:00:00 rpc.idmapd
4829 ? 00:00:00 rpc.rquotad
4831 ? 00:00:00 rpc.mountd
4836 ? 00:00:00 rpc.statd

Fedora systemctl output:
nfs-idmap.service loaded active running NFSv4 ID-name mapping daemon
nfs-lock.service loaded active running NFS file locking service.
nfs-mountd.service loaded active running NFS Mount Daemon
nfs-rquotad.service loaded active running NFS Remote Quota Server
nfs-server.service loaded active exited NFS Server
rpcbind.service loaded active running RPC bind service
rpcbind.socket loaded active listening RPCbind Server Activation Socket
 
Old 02-12-2013, 09:10 AM   #2
kbscores
Member
 
Registered: Oct 2011
Location: USA
Distribution: Red Hat
Posts: 259
Blog Entries: 9

Rep: Reputation: 32
I believe you only need

nfs
nfslock

Could someone confirm?
 
Old 02-13-2013, 10:41 PM   #3
jaymzter
LQ Newbie
 
Registered: Apr 2005
Location: Republic of Texas
Posts: 9

Rep: Reputation: 0
Why are you being so specific? Are there services 192.168.1.1 and 192.168.1.2 shouldn't access? If not, why not just use the following in /etc/hosts.allow?
Code:
192.168.1.1: ALL
192.168.1.2: ALL
 
Old 02-14-2013, 01:52 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
You'd use the program name (not the service name) and allow the addrs you want, then deny everything eg
Code:
# /etc/hosts.allow
ALL : 127.0.0.1 
sshd: 192.168.1.1, 192.168.1.2

# /etc/hosts.deny
ALL: ALL

Last edited by chrism01; 02-14-2013 at 01:56 AM.
 
Old 02-15-2013, 08:11 AM   #5
ssenuta
Member
 
Registered: Mar 2006
Location: NYS
Distribution: Mandriva-2006
Posts: 123

Original Poster
Rep: Reputation: 16
Thank you all for responding.
Here is what I decided to use for tcp-wrapper security:

host.allow:
ALL:192.168.1.1/255,255.255.0
All:192.168.1.2/255.255.255.0

host.deny:
All:192.168. EXCEPT 192.168.1.1 192.168.1.2 ..This entry is probably all that is needed as it should cover all the "daemon-processes" listed below & more

sshd:All EXCEPT 192.168.1.1 192.168.1.2
rpcbind:All EXCEPT 192.168.1.1 192.168.1.2
mountd:All EXCEPT 192.168.1.1 192.168.1.2
statd:All EXCEPT 192.168.1.1 192.168.1.2
rquotad:All EXCEPT 192.168.1.1 192.168.1.2
idmapd:All EXCEPT 192.168.1.1 192.168.1.2
lockd:All EXCEPT 192.168.1.1 192.168.1.2

It is my understanding that just listing a host in the host.allow file doesn't stop other hosts from connecting. You have to exclude them or deny them by access to daemon processes running on your network by specific entries in the host.deny file.

My host.deny file may be a bit redundant but I wanted to list the specific daemon-processes my wireless net was using. Just using "All" for the daemon-process denies access to all tcp-wrapper libary linked processes. I wanted to know what processes are being blocked.

The big problem for me was finding out what "names" to use in the host.deny file. I spent a lot of time reading the manual pages & searching the web before I decided on the names shown above. I hope I have it right.
 
  


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
Define TCP Wrapper sathish80 Linux - Newbie 5 08-14-2009 09:04 AM
Logging with tcp/wrapper Amit Agarwal Linux - Newbie 1 07-06-2009 11:55 PM
About xinetd and TCP wrapper jack1234 Linux - Networking 0 09-15-2005 08:10 AM
nfs over tcp confusion linuxboy123 Linux - Software 2 08-19-2004 04:19 PM
xinetd or tcp wrapper ? phoenix99 Linux - Security 2 08-15-2004 05:37 PM

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

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