Transferring files from a linux server to a centos machine
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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:
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.
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.
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..
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.