LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-21-2007, 11:52 AM   #1
Jhorra
LQ Newbie
 
Registered: Mar 2004
Posts: 19

Rep: Reputation: 0
Simplest way to allow one linux machine write permissions to another linux box


I have two linux machines, and I need one machine to have write permissions to one folder on the other box. This will be people using a PHP script to upload images, but when I move the files I want it to move them over to the other machine.

My understanding is I can create a user with permissions on that folder, then when I do the move have it move them as that user.

Can anyone help me out with this?
 
Old 06-21-2007, 12:41 PM   #2
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
If these two computers are on the same LAN, and the LAN is secure, then the simplest method is to use nfs. Nfs is not really secure, but it's easy and provides very good performance.

In order to share files with nfs, you need to install an nfs server and modify the file /etc/exports. The exact method of installing an nfs server depends on the linux distribution involved.
 
Old 06-21-2007, 12:44 PM   #3
Jhorra
LQ Newbie
 
Registered: Mar 2004
Posts: 19

Original Poster
Rep: Reputation: 0
They should be secure, but I would rather not make that assumption.
 
Old 06-21-2007, 01:11 PM   #4
dx0r515t
Member
 
Registered: Jan 2005
Location: USA
Distribution: Slackware 10.2 & 11.0
Posts: 155

Rep: Reputation: 30
He says nfs is not really secure because nfs does not encrypt your passwords. This would be a huge problem if you were going to use it between two machines over the internet without tunneling of some kind. However if both PC's are in a trusted private LAN you really should be fine with nfs. I use nfs all the time on my own LAN and it's great. You just have to remember that with nfs it will not encrypt your passwords so only use it in trusted LAN’s.
 
Old 06-21-2007, 01:23 PM   #5
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
Umm...while it's technically true that nfs does not encrypt your passwords the reason is because nfs doesn't bother sending any passwords in the first place! Nfs security simply assumes that the other computer has already verified the user is legitimate. No passwords are ever exchanged with nfs. The server simply receives requests along with UID and GID numbers and the server just trusts the client computer has already checked passwords and such.

The passwords on the two different computers don't have to match. The usernames or groupnames on the different computers don't need to match either. For example, if user 1000 on the server is "kirk" and user 1000 on the client is "spock", then as far as the client computer can tell all of the files are owned by "spock". Conversely, file access requests from "spock" are seen by the server as if they were from "kirk". Neither computer ever sends any user names or passwords to the other over the network. They're entirely unaware that neither the user names nor the passwords match. All that's passed between them are uid and gid numbers.

What this means on an unsecure LAN is that any bad guy can connect his own computer with whatever user names and passwords he wants, and he can access nfs shared files pretending to be any user--even root.

You can do some things to mitigate the risk. The default "root_squash" option removes special root privileges, which puts a small speedbump into a bad guy's efforts. You can define nfs shares to only be accessable by particular IP addresses, but on an unsecure LAN a bad guy's can set his computer to pretend to be any IP address.
 
Old 06-21-2007, 01:28 PM   #6
Jhorra
LQ Newbie
 
Registered: Mar 2004
Posts: 19

Original Poster
Rep: Reputation: 0
So basically, I would set up a NFS server on the machine I want to move them to. Would the upload page itself be able to move them over, or would that have to be a manual move?
 
Old 06-21-2007, 07:46 PM   #7
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
You have many options. One option is to directly mount the nfs share in the web server's upload directory. Then you don't actually need to "move" any files. But if you'd rather use PHP scripting to first upload it to a directory on the web server and then move the file over, you can do it that way also.
 
  


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
Samba - No Write Access from Linux Box HKDude Linux - Networking 6 05-30-2005 02:59 PM
Is it possible to log onto your home linux box from another machine running linux?! Gormless Linux - General 7 10-26-2004 10:27 PM
Password Message Box when accessing linux box from Window Machine mikeccs Linux - Networking 1 08-04-2004 05:47 AM
adding linux box to simplest network rank_n00b Linux - Newbie 5 07-25-2004 11:26 PM
I want my linux machine to read/write to an XP share bjs Linux - Newbie 8 03-26-2004 03:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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