LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Transferring files from a linux server to a centos machine (https://www.linuxquestions.org/questions/linux-newbie-8/transferring-files-from-a-linux-server-to-a-centos-machine-943863/)

vineetcornelius 05-08-2012 05:47 AM

Transferring files from a linux server to a centos machine
 
I have some files and directories on my local linux server. I have prepared another computer with centos5 installed on it.
I want to copy some files and directories from the linux server to the centos machine.

How can i do it using the ftp command from my centos m/c. As this is a repetitive job. Is there any other better way to do it by rsync command.

I am new to the linux os kindly help. A step by step instruction will be very helpful.

Thanks

em31amit 05-08-2012 06:12 AM

scp, rsync, ftp, sftp are the default tools. SCP can be a good option here.

divyashree 05-08-2012 06:27 AM

You can use scp/rsync to achieve this. You are using ftp As this is a repetitive task you can export the public key of your CentOS machine to the linux server and set the scp/rsync command by cron.

Steps to do in CentOS machine :
Quote:

1 - ssh-keygen - this command will generate the pub/priv key pair and ask you for the location to store it.

dont change and keep the default directory

2 - Now it will ask for a pass-phrase - keep it blank( press enter )

3 - Now it will create the keypair.

4 - ssh-copy-id -i ~/.ssh/id_rsa.pub user@x.x.x.x ( x.x.x.x - ip of linux server )

5 - Now it will ask for password for linux server

6 - After giving the password it will export the pubkey to the linux server.

7 - Now use scp : scp -r user@x.x.x.x:/path/to/source/in/linux/server/file </path/to/destination/centos/dir>

8 - You can set this scp line in crontab at the time you want the machine to copy files for you.


If you want to use rsync with help of ssh(secure connection), use the below command:

9 - rsync -avuz -e ssh user@x.x.x.x:/path/to/source/in/linux/server/file </path/to/destination/centos/dir>

10 - If you dont want to use ssh , just remove the <-e ssh> .

11- YOu can also put this rsync in cron to make the CentOS machine work for you.

Ajit Gunge 05-08-2012 06:28 AM

Is there a tool like winscp for linux GUI based machines.Where I can just drag and drop the files and folders from server to machines and vice versa.

em31amit 05-08-2012 06:34 AM

you can open other server filesystem using nautiles in centos/redhat/fedora distro.


ssh://serverIP

em31amit 05-08-2012 06:36 AM

A less known feature of Nautilus is the fact that it has a built-in scp “client” that you can use to copy files to remote machines via ssh without the need to type any command in the shell or installing any package on the machine, in this post I’m going to show you how this works.

All you need to do is to open a File Browser instance on a folder of your choice and then use the key combination CTRL + L to edit the address bar on top of the window :

Now simply edit the address bar with the name or IP address of the machine to which you wish to connect putting ssh:// before the name/IP like this :



You will, of course, be asked for authentication and given to option to store the username/password combination in a permanent way or let the file browser trash the credentials immediately (actual options and graphic could change from one Desktop Environment to another but not the actual functionality) :



Just issue the correct authentication parameters and the content of the remote machine file system will be presented in the window as local folders/files, to copy something to the remote machine simply drag the needed files/directories into this window and you are good to go.

Ajit Gunge 05-08-2012 07:32 AM

Hi Em31Amit.Thanks for the tip.Thats was something new to me.Now I want to try it but the problem that I have in hand is this.

I am running a virtual machine having guest OS as fedora and host OS as windows machine and I want to try this feature.Do you have any idea how do I see it working.I dont have any additional harware or machine.

em31amit 05-08-2012 11:26 AM

hiya

yes, you can change interface connection type to see physical machine's shares into guestos. combination of correct ip address/subnet and virtual machine interface connection will work fine. just make sure about those..

chrism01 05-08-2012 07:19 PM

Re a GUI client; I recommend Filezilla; runs on Linux & MS; can use ftp or sftp.
http://filezilla-project.org/download.php?type=client
I use it all the time at work.


All times are GMT -5. The time now is 09:50 AM.