netcat + tar (fast but less secure)
To send a directory, cd to inside the directory whose contents you want to send on the computer doing the sending and do:
$ tar -cz . | nc -q 10 -l -p 45454
On the computer receiving the contents, cd to where you want the contents to appear and do:
$ nc -w 10 $REMOTE_HOST 45454 | tar -xz
ip / hostname of computer doing the sending. You can also use a different port instead of 45454.
Copying Files with SCP
$ scp <file> <username>@<IP address or hostname>:<Destination> $ scp -r (recursive) username@server:(remote location) (local location) $ scp -r (local location) username@server:(remote location)
on client, install
sudo apt-get install sshfs
Mounting the Remote File System
sshfs -o transform_symlinks -ofollow_symlinks user@hostname: [dir]mountpoint. e.g. :
sshfs –o cache=yes,allow_other email@example.com:/home/user/code home/user/code
for detail, ref
sudo umount mountpoint
is your want many user to visit your shared folder, you may use NFS. Ref this for detail.
samba is very convenient tool for sharing files between win-Linux, just like NFS.
How to set up
refer this tutorial
sudo apt update sudo apt install samba mkdir /home/<username>/sambashare/ sudo vim /etc/samba/smb.conf
add follow in smb.conf
[sambashare] # the name show on remote comment = Samba on Ubuntu path = /home/username/sambashare read only = no browsable = yes
sudo service smbd restart
add user to samba and set passward, Username used must belong to a system account, else it won’t save.
sudo smbpasswd -a username
On Windows, open up File Manager and edit the file path to: