Syntax for copying files TO a server
=======================================
scp /source_dir/file_name user@target_box:target_dir/
For example
scp /vipul/sample.txt root@ajooba:/
will copy the sample.txt to a server name ajooba's root [/] directory.
The another example will copy the entire directory from the source directory to target directory
scp -r /export/source_dir/ root@aconite:/target_dir
Similiarly, scp can be used to copy files FROM a server
Copying file from host:
scp user@Source_Machine:directory/
Note -- If the root is being used to copy the files please note that root have the following entry marked as yes in /etc/ssh/sshd_config
PermitRootLogin yes
The scp may thorw permission denied exception in case the permission is set to No
Reference taken from -- http://en.wikipedia.org/wiki/Secure_copy#SCP_program
No comments:
Post a Comment