3

Sharing a folder on Windows is a trivial matter. Sharing a folder on linux appears to be done only using Sambashare. At least, every guide I've found is using this approach. It's quite terrible, requiring config files, user groups, additional packages etc. Is there a way to share a local folder without this program? Right now, it seems to be easier to upload things to the cloud to transfer files between two linux computers on a LAN.

1
  • personally, to simply copy files between *nix machines, I use scp ... to share, I use nfs (the latter does requires a certain amount of fuxoring with config files though, so probably not for you) another candidate is sshfs - though, I've never looked at that Commented Jan 9, 2023 at 8:20

5 Answers 5

1

Sharing between linux machines is also trivial an arguably easier and more secure than on windows.

Samba is an implementation of native windows sharing under linux to provide interoperability between the two OS's.

If you simply want to download files from the server on say windows you can connect to it over SSH and use something like filezilla to download/upload files from the machine. This won't require any further software, is secure and relatively fast.

1
  • Good point. I forgot about this method. Commented Jan 11, 2023 at 16:08
1

I do not know why samba is the first option people suggesting, since native Linux way is NFS. This is very simple:

On the server:

  1. sudo apt install nfs-kernel-server
  2. sudo vim /etc/exports
  3. Add an exported folder entry, e.g. : /home/pi/Downloads *(rw,async,no_root_squash,no_subtree_check) - this gives everybody read-write access, replace "*" with actual ip of your client machine, for more options consult the docs.
  4. sudo exportfs -arv
  5. sudo systemctl enable --now nfs-server

Now that server is ready, on client:

  1. sudo mkdir -p /mnt/my_nfs_share
  2. sudo vim /etc/fstab
  3. add automatic mount e.g. your.server.ip:/home/pi/Downloads /mnt/pi_nfs_share nfs defaults,vers=4 0 0
  4. sudo mount -a

That's it, you have your server folder available on the client at /mnt/my_nfs_share

0

Samba is the standard Windows interoperability suite of programs for Linux and Unix. Since 1992, Samba has provided secure, stable and fast file and print services for all clients using the SMB/CIFS protocol, such as all versions of DOS and Windows, OS/2, Linux and many others.

Samba is the name of the linux software, what you refer to as sambashare, and not to be confused with SMB which does not mean samba but rather Server Message Block which is a protocol.

To share a local linux folder on a network, such that it is mountable between systems on the network and shows up as D: in windows then you have to use the SMB (service message block protocol) because that's what Windows knows. To go between two linus systems you would use NFS.

every guide I've found is using this approach. It's quite terrible, requiring config files, user groups, additional packages etc.

you're listening/reading from the wrong people. Samba is very easy, and in RHEL/CentOS 7, 8, or 9, the default /etc/samba/smb.conf file (one file) is already pre set up such that all you need to do is systemctl enable smb and your /home/<username folder is already shared out, provided you already have done yum install samba. Know that it does not share out your home folder, or any, such that it is then world readable/writeable to the world via SMB, it's as simple as having your linux username the same as your windows username and your windows login password the same as your linux login password and you get unprompted access.

note: stupid SELINUX (secure linux) requires doing an additional setsebool -P samba_enable_home_dirs on so I could see how not knowing that could piss one off and hate samba.

1
  • Here's a typical guide I tried. zdnet.com/article/… Config file, users, usergroups. There were some errors along the way, I had to solve too. Also had to restart my machine in the end. By no means easy. Commented Jan 11, 2023 at 16:12
0

if you dont care about login/password, and dont care being able to upload files, do this on both machines at the folder you want to share:
python3 -m http.server
then browse to the IP of each other machine port 8000
so if you need to upload, just go on the other machine and download ;)

I have 2 machines connected with ethernet cable, and this is like 9999999% easier than trying to make samba work (in case it is not of course).

tip from: https://www.reddit.com/r/Ubuntu/comments/qnvme3/comment/hjnsiai

-1

The answer by proxx is good, i.e., that one can just use ssh and scp/rsync for the transfer. However, a better method that works across platforms is Syncthing. Setup was trivial, and this has the benefit of working over LAN, and over the internet working over the internet without having to deal with port forwarding in the router.

For Windows to Linux via Syncthing, there's also SyncTrazor which is just a GUI wrapper.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.