LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to share a folder from linux to linux (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-share-a-folder-from-linux-to-linux-795956/)

vasanithyd 03-17-2010 02:07 AM

how to share a folder from linux to linux
 
how to share a folder from linux to linux systems and setting password to open that folder

Sayan Acharjee 03-17-2010 02:08 AM

You can use SAMBA to do that.

catkin 03-17-2010 02:18 AM

Quote:

Originally Posted by sayan_acharjee (Post 3901389)
You can use SAMBA to do that.

But NFS would be a better choice because Samba is designed for sharing with Windows systems and the Linux ownerships-groupships-permissions model does not map readily into Windows' equivalents.

Sayan Acharjee 03-17-2010 02:29 AM

Quote:

Originally Posted by catkin (Post 3901402)
But NFS would be a better choice because Samba is designed for sharing with Windows systems and the Linux ownerships-groupships-permissions model does not map readily into Windows' equivalents.

But how will NFS ask for username and password for a specific user?

freelinuxtutorials 03-17-2010 04:27 AM

Quote:

Originally Posted by sayan_acharjee (Post 3901420)
But how will NFS ask for username and password for a specific user?

if linux to linux, it is being controlled on /etc/exports for NFS server
and /etc/fstab for NFS client

You can specify user and IP address allowed to mount it on NFS server

Sayan Acharjee 03-17-2010 04:38 AM

Quote:

Originally Posted by freelinuxtutorials (Post 3901517)
if linux to linux, it is being controlled on /etc/exports for NFS server
and /etc/fstab for NFS client

You can specify user and IP address allowed to mount it on NFS server

I know specific ip can be specified in the /etc/exports file which will be able to mount the share, here we are talking about user name and password from a specific ip, i.e., from the same ip one user will be able to mount it with correct user name and password and others can't.

freelinuxtutorials 03-17-2010 05:07 AM

Quote:

Originally Posted by sayan_acharjee (Post 3901525)
I know specific ip can be specified in the /etc/exports file which will be able to mount the share, here we are talking about user name and password from a specific ip, i.e., from the same ip one user will be able to mount it with correct user name and password and others can't.

Then SMB share is the right way to do it. and choose any db backend that you want for storing username/pass.

Sayan Acharjee 03-17-2010 05:10 AM

Quote:

Originally Posted by freelinuxtutorials (Post 3901548)
Then SMB share is the right way to do it. and choose any db backend that you want for storing username/pass.

Thats what I said to OP in my first post in this thread.

jamescondron 03-17-2010 05:24 AM

There are more than two network filesystems; and SAMBA is, frankly, a horrible piece of advice.

Consider how one mounts NFS , and consider the options in /etc/exports.
Code:

man exports
should be read before making decisions based upon how you can use it.

But what about SSHFS? The SSH File System? Thats a good way of using native ACLs and so on.
In fact, there are several ways and methods that work if NFS does not have the options you want.

samba, however, is not one of these; nor has it ever, nor will it be.

Sayan Acharjee 03-17-2010 05:30 AM

Quote:

Originally Posted by jamescondron (Post 3901565)
There are more than two network filesystems; and SAMBA is, frankly, a horrible piece of advice.

Consider how one mounts NFS , and consider the options in /etc/exports.
Code:

man exports
should be read before making decisions based upon how you can use it.

But what about SSHFS? The SSH File System? Thats a good way of using native ACLs and so on.
In fact, there are several ways and methods that work if NFS does not have the options you want.

samba, however, is not one of these; nor has it ever, nor will it be.

OP wanted to share a directory in such a way that whenever a user wants to access it from a remote system, it will ask for user name and password.
Samba is what came to my mind for the first time 'cos this can be achieved with samba, am I wrong there? I'd like to know how samba doesn't fit according to the OP's criteria?

freelinuxtutorials 03-17-2010 05:38 AM

Quote:

Originally Posted by sayan_acharjee (Post 3901552)
Thats what I said to OP in my first post in this thread.

haha.sorry. i got carried away on the NFS posts.
if you want to have username/password prompting user on shared folders. I will do it by samba as well.

blacky_5251 03-17-2010 05:47 AM

It would be good if the OP gave more information about what needed to be mounted. When I first read his post, autofs came to mind but I was thinking/assuming he might have been talking about home dirs.

catkin 03-17-2010 06:11 AM

Quote:

Originally Posted by sayan_acharjee (Post 3901420)
But how will NFS ask for username and password for a specific user?

Good point and my apologies for missing that :redface:

Sayan Acharjee 03-17-2010 06:13 AM

Quote:

Originally Posted by catkin (Post 3901617)
Good point and my apologies for missing that :redface:

Happens ;) By the way, can I send you a friend request? :D

jamescondron 03-17-2010 06:19 AM

Quote:

Originally Posted by sayan_acharjee (Post 3901568)
OP wanted to share a directory in such a way that whenever a user wants to access it from a remote system, it will ask for user name and password.
Samba is what came to my mind for the first time 'cos this can be achieved with samba, am I wrong there? I'd like to know how samba doesn't fit according to the OP's criteria?

Its a little like OP wanting to drive a nail into a wall, and you suggesting a stale turnip. Yeah, it'd be hard enough, and yeah it'd work, but turnips are not a tool we should be using.

samba is not a viable tool for *nix systems because of the major differences between permissions, ACLs and authentication. Which is why I suggested OP looks at what NFS can/cannot be configured to do and possibly use sshfs.

In this case sshfs is the most viable option; sshfs is the hammer the nail needs.


All times are GMT -5. The time now is 07:10 PM.