Copy Files via SSH from Another Server FTP

Recently for one of my project our server was hacked and some files were deleted and corrupted with malwares. So we had to restore the old backups. We were using the contabo web server where we have separate backup server with 100 GB space which was accessible only through FTP from the SSH. So in this blog I am going to explain how you can copy files Copy Files via SSH from Another Server FTP.

Step 1: Login to SSH with your SSH username and password. 

ssh yourusername@host

On prompt of password enter password and login.

Step 2 : Go to directory where you want to copy files from FTP.

cd /yourpath/to/folder

Step 3: Connect to FTP

Use following command to connect to FTP

ftp hostname

It will ask for username and password. Once you enter correct username and password, you will get ftp command prompt.

Step 4 : Go to directory from where you want to copy files on FTP.

cd /yourpath/to/folder
You can use cd command on FTP just like you  use on SSH.

Step 5 : Copy Specific File.

Use following command to copy file.
get filename
And wait for the process to be finished.

Step 6 : Exit From FTP

Use following command to close FTP and return back to SSH.
bye
With this you will close the FTP session and you are back to SSH session and you can see the copied files using LS command.
This entry was posted in Command Line, FTP, Server Admin, SFTP, SSH, System Admin on by .

About Hiren Dave

Hiren Dave is a software engineer, blogger and consultant with over 9 years of professional experience. He writes code in number of languages. Hiren has a passion for developing web apps, mobile apps and writing books and blog articles about programming. He has a solid experience of startups as he manages products for few startups. He is also passionate about researching and learning new technologies and trends. He has also authored a book Instant Sencha Touch, published by Packt and creator of Video Course "Beginning Laravel" for Packt

Leave a Reply

Your email address will not be published. Required fields are marked *