Saturday 26 April 2014

Copy files from linux to another linux server

There are other ways to copy files from a linux server to another linux server. We can use ftp protocol as well but that requires configuration. easiest way is to transfer files using scp.
Scp means “secure copy” it is based on SSH protocol which itself is secure protocol. To transfer files from Windows machine to linux or vice versa there is a software called winscp which can be easily install on windows machine. and it can transfer files to and from Linux server.
To copy files from one linux machine to another following methods is used:
[root@centos]#scp
-bash: scp: command not found
 “this means that scp rpm is not installed on the server. package openssh-clients needs to installed”
[root@centos]# yum install openssh-clients –y
“to install rpm”
To copy file use:
Scp /home/testfile.txt root@serverip:/home/
” to copy files from server you are logged in to a remote server”where serverip can be hostname of that server or what ever the ip that server has.”
To copy directory and all it content we use:
Scp -r /home/testdir root@serverip:/home/dir
” to copy directory and all its content we use the above command”

No comments:

Post a Comment