Disk/Folder sharing over network
Hi,
I am sure my problem is quite easy to solve, but i have a blackout, and can't find right answer. I have Linux machine with big/secure storage, lets call it server, and other machine, lets call it client. I need some kind of configuration in which i mount this disk persistent(via fstab) and let users use it as regular mounted partition. I tried with samba and nfs, but problem is users permissions. I am not able to set actual user as owner (it sets as uid who mounted share). Lets say on client mashine i am logged as user Bob, but when i use Code:
touch /mnt/share Is it possible to make such configuration it via samba? If no, how can i achive this(mount network share like regular disk partition) |
If you create an SMB/CIFS share you can mount it on Linux via fstab by specifying the UID and GID of the user on the client:
//<server>/directory /<client path directory> cifs username=<user>,password=password,uid=<UID>,gid=<GID> 1 4 |
personally, i use sshfs.
if you have a little experience with ssh, sshfs should come quite naturally. just my 2ct. |
If you use Samba (advisable if you have Windows machines in your network), Samba is the way to go.
Please provide some more information: Do you want the share to accessible to all users, or only to one ("Bob"?)? What distro/version are you using? The overview is this: 1. Include the partition in /etc/fstab, ideally by label or UUID, so it always mounts to the same location location in /media or /mnt. 2. Share the partition via /etc/samba/smb.conf file. 3. Create a password for the user(s) in /etc/samba/smbpasswd file. 4. In the directory configuration, mark the partition as shared. (This step is separate from the Samba configuration), as well as configure whether it's read only, read/write, etc. Some distros include an item in their control centers that provides GUI tools for sharing a partition, so I'm holding off on going into a lot of command line details. A search for "configure Samba [distroname]" should lead you to to some tutorials for your distro. Also, sshfs does work very nicely to do what it does. I use Samba in my home network, because we have Linux, Windows, and the occasional Mac access various shares. |
Hi,
I will take a look on sshfs, but its additional software to install, and would like to find other solution first for security reasons. I would prefer samba, as already used and implemented solution. Answers to questions: 1)Do you want the share to accessible to all users? Yes, each user logged on client should be able to access such "device", but mounting should be password protected in samba(each client linux should have own samba account for mounting such a device) I have disk array mounted on server and shared via samba, here conf Code:
[testshare] Quote:
|
Quote:
i'm using sshfs after login, because ssh key initialization also happens then and without that i cannot use it. |
Well, i made some research. Sshfs uses fuse library, which makes it quite vunerable to attacks, so it's hard to say if it is just wrapper around ssh. It is production enviroment, and i can't install any untested kernel modules due to security and stability reasons.
|
Did you see my post early in the thread? As I noted you can mount the SMB (Samba) share as a cifs mount on each client specifying the UID of the user on that client as owner for that client.
|
Quote:
anyhow, the sshfs man page clearly states: Quote:
i don't see any problem there. |
Quote:
Quote:
|
is this remote server running windows or linux/unix? Is this filesystem ntfs or ???
You do not need to specify valid users if any user allowed to use its own user id. |
Quote:
|
samba should only be used in case of ntfs/windows, otherwise it is not the right tool. I would recommend you yo use nfs instead.
From the other hand you need to configure samba to allow users to use their own ids, you need to remove forcing that smb_user. |
Quote:
|
Quote:
|
All times are GMT -5. The time now is 10:42 AM. |