Use sshfs to remotely mount

Uni-directional mirroring rsync or unison

  • use ssh by default
  • support incremental copy
  • on-line compression
# use like a distributed version control
rsync -urltv --delete -e ssh src.dir othermachine:/destination.src.dir

# `rsync` to local by default
rsync --compress-level=9 -av username@hostname:path/to/folder
# or use
rsync --compress-level=9 -av username@hostname:path/to/folder path/to/local/folder
  • --compress-level use to manually specify compress level or you can use -z to use the default level
  • -a archive. Keep file timestamps in intact and only copy modified files
  • -v verbose.

Setup samba for remote file sharing

# install `samba`
yum install samba samba-client samba-common
sudo apt-get install samba

# start `samba` at boot time if you like
chkconfig smb on
chkconfig nmb on

# backup your config file
cp /etc/samba/smb.conf /etc/samba/smb.conf.bak

# create a user for smb
useradd smbuser
groupadd smbgrp
usermod -a -G smbgrp smbuser
smbpasswd -a smbuser

# change permission of your folder
chown -R smbuser:smbgrp path/to/folder/
chmod -R 0770 path/to/folder/

# test your configuration
testparm

# restart services
service smb restart
service nmb restart

reference

FTP

# install `vsftpd` with any method
yum install vsftpd
apt-get install vsftpd

# if you enable anonymous user login, the `pub` directory is in `/var/pub`
> anonymous_enable=YES
> local_enable=YES

# restart service
/etc/init.d/vsftpd restart

reference