LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 03-04-2020, 03:52 AM   #1
elsmandino
Member
 
Registered: Oct 2009
Posts: 103

Rep: Reputation: 0
SMB vs NFS - why no password needed for NFS?


This is not a problem as such - it is more my trying to build up my knowledge of how Linux works.

I have a Server that shares a folder via both SMB and NFS.

I can access the folder, via SMB, on either a Linux or Windows PC and need to give a password first.

However, on the Linux PC only, I can mount the folder, via NFS, and it just seems to work.

I have tried to Google why and it seems the difference is that SMB is password-based. However, in contrast, it seems that NFS is host-based and thus no password is needed on the client side.

I would be really grateful if someone could explain what "host-based" means in this situation?
 
Old 03-04-2020, 04:00 AM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Access on the server is controlled by /etc/exports, where you can limit the hosts that have the right to mount a file system. Thus host-based.
 
1 members found this post helpful.
Old 03-04-2020, 04:17 AM   #3
elsmandino
Member
 
Registered: Oct 2009
Posts: 103

Original Poster
Rep: Reputation: 0
Thank you, berndbausch - this makes much more sense now.

I tend to do things, on my server, without understanding exactly why - something I am trying to remedy at the moment.

So, on the server, there will be options for the NFS mount that dictate the range of ip addresses that are allowed to mount the folder?
 
Old 03-04-2020, 07:14 AM   #4
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Yes. Try man exports.
 
1 members found this post helpful.
Old 03-04-2020, 09:50 AM   #5
uteck
Senior Member
 
Registered: Oct 2003
Location: Elgin,IL,USA
Distribution: Ubuntu based stuff for the most part
Posts: 1,177

Rep: Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501
If you do need to limit access to files on the NFS share, then you need to change the permissions of the file's owner to a different user ID.
Usually this is done when using NFS with NIS. NIS is like an old UNIX version of Active Directory before MS copied it and made AD. Each user would have a different user ID and thus only be ably to access the directory they owned on the NFS server.
 
1 members found this post helpful.
Old 03-04-2020, 10:49 AM   #6
elsmandino
Member
 
Registered: Oct 2009
Posts: 103

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by uteck View Post
If you do need to limit access to files on the NFS share, then you need to change the permissions of the file's owner to a different user ID.
Usually this is done when using NFS with NIS. NIS is like an old UNIX version of Active Directory before MS copied it and made AD. Each user would have a different user ID and thus only be ably to access the directory they owned on the NFS server.
OK - let me see if I understand this, with a real-life example.

I am running an Openmediavault Server, with an NFS share called "Media" - any ip address, on my network, is allowed to mount this folder.

My Linux Desktop is set up in the name of "john", so I assume that if I mount this folder and create a new file, it will be set up with an owner of "john".

Does that mean that if I change permissions, on that file, to chmod 755, only someone using my Linux PC (signed in as "john") can then modify the file?
 
Old 03-04-2020, 01:54 PM   #7
uteck
Senior Member
 
Registered: Oct 2003
Location: Elgin,IL,USA
Distribution: Ubuntu based stuff for the most part
Posts: 1,177

Rep: Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501
I should have clarified that the file permissions need to be set on the NFS server, not by any system that connects to it, for proper control. Try creating a file on the share as root from your desktop and it should complain.
The NFS server will consult it's /etc/passwd, or the NIS server, for the user ID and allow or deny access to the file or directory accordingly. So in your example, anyone that connects to the share will be able to see the file you made, and if the user ID matches then make changes. The file is not owned by 'john' but by a user ID that also has a name.

The downside to NFS shares now days is that the first user ID on a new Linux system is usually 1000, so any Linux system running with a user with that ID will get access to all the files owned by that ID if it is allowed to connect to the NFS share. Back in the old UNIX days it was not an issue since there was only the one server on site that users had access rights to, and security was not something to worry about.
 
  


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
smb mount folders disappear on mount & konqueror smb fails: network unreachable tisource Linux - Networking 1 10-17-2007 12:30 AM
SMB: More then one Windows user/ smb account? 1veedo Linux - Networking 2 03-15-2005 04:16 PM
smb+KDE= :-) smb+Gnome= :-( awing_pilot Linux - Software 3 03-10-2005 10:38 PM
Creating a SSL connection from smb clients to a smb server scottpioso General 0 11-17-2003 02:33 PM
making smb shares viewable from smb client via web browser scottpioso General 3 11-10-2003 04:25 PM

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

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