Before doing the file transfer you need to have the ssh installed.
sudo apt-get install sshAfter that reboot the machine or enter the following command.
/etc/init.d/ssh restartThe command used to copy files is,
scp [options] source-file [user@to-host-ip:]Some of the [options] that may be used frequently include,
-r :Recursively copies entire directories. Use this if you are copying directories
-l : Limits the used bandwidth, specified in Kbit/s
'user' is a user in the remote host, and 'to-host-ip' is its IP address. Type command ifconfig on remote host to get to know the IP address of the it.
Full command according to the manual(man scp) is,
scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file] [-l limit] [-o ssh_option] [-P port] [-S program] [[user@]host1:]file1 ... [[user@]host2:]file2For example, to copy a directory named scpTest/ from your machine to a remote host(user-name:kasun, ip:10.100.1.220), Go to the Directory which contains the scpTest/.
scp -r scpTest/ firstname.lastname@example.org:(Note the colon : at the end.) It will ask for the user password. Provide it and the progress meter appears showing the progress of the file copying. Files/Folders will be copied to the home folder.
That's it! Just ask/comment if you got any problem.