LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-08-2012, 05:47 AM   #1
vineetcornelius
LQ Newbie
 
Registered: May 2012
Posts: 24

Rep: Reputation: Disabled
Unhappy 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
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 05-08-2012, 06:12 AM   #2
em31amit
Member
 
Registered: Apr 2012
Location: /root
Distribution: Ubuntu, Redhat, Fedora, CentOS
Posts: 190

Rep: Reputation: 55
scp, rsync, ftp, sftp are the default tools. SCP can be a good option here.
 
Old 05-08-2012, 06:27 AM   #3
divyashree
Senior Member
 
Registered: Apr 2007
Location: Bangalore, India
Distribution: RHEL,SuSE,CentOS,Fedora,Ubuntu
Posts: 1,386

Rep: Reputation: 135Reputation: 135
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.

Last edited by divyashree; 05-08-2012 at 10:44 AM.
 
Old 05-08-2012, 06:28 AM   #4
Ajit Gunge
Member
 
Registered: Jan 2008
Location: Pune
Distribution: RHEL,fedora
Posts: 253
Blog Entries: 1

Rep: Reputation: 21
Question

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.
 
Old 05-08-2012, 06:34 AM   #5
em31amit
Member
 
Registered: Apr 2012
Location: /root
Distribution: Ubuntu, Redhat, Fedora, CentOS
Posts: 190

Rep: Reputation: 55
you can open other server filesystem using nautiles in centos/redhat/fedora distro.


ssh://serverIP
 
Old 05-08-2012, 06:36 AM   #6
em31amit
Member
 
Registered: Apr 2012
Location: /root
Distribution: Ubuntu, Redhat, Fedora, CentOS
Posts: 190

Rep: Reputation: 55
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.
 
2 members found this post helpful.
Old 05-08-2012, 07:32 AM   #7
Ajit Gunge
Member
 
Registered: Jan 2008
Location: Pune
Distribution: RHEL,fedora
Posts: 253
Blog Entries: 1

Rep: Reputation: 21
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.
 
Old 05-08-2012, 11:26 AM   #8
em31amit
Member
 
Registered: Apr 2012
Location: /root
Distribution: Ubuntu, Redhat, Fedora, CentOS
Posts: 190

Rep: Reputation: 55
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..
 
Old 05-08-2012, 07:19 PM   #9
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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.

Last edited by chrism01; 05-08-2012 at 07:20 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Transferring files to server blufire Linux - Server 11 01-19-2012 11:10 PM
transferring files to from Windows machine to Linux bbb125 Linux - Newbie 21 08-17-2010 06:51 AM
USB security - transferring files from infected windows machine to Linux box leighz Linux - Security 5 03-05-2009 09:11 AM
How to transferring files from linux machine to linux machine and windows Dinimani Debian 3 05-12-2008 05:50 AM
Transferring files from linux to windows (using terminal server) hondo Linux - General 1 08-13-2007 07:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration