How to upload file with FTP to another Linux server through SSH

Posted on 2006-05-16
Last Modified: 2010-04-20
Hi Everyone,

I have two Linux servers. I want to upload a file from one of my Linux server to second one using FTP protocol through SSH.

How can i do this?

I don't want to download it from the first server and then upload it to second server.

Please help, thank.

p.s.: Urgent
Question by:blacklord
    LVL 8

    Accepted Solution

    use scp

    login to one server1 via ssh then do..

    scp filename username@server2:/path/to/directory

    Author Comment

    Thanks for quick answer but when i try this it gives "lost connection" error.

    What can be the reason?
    LVL 8

    Expert Comment

    are you able to connect to both machines through ssh?

    Author Comment

    ahh, got it. I was trying to connect with incorrect user.

    Thanks, you got the points!


    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
    You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
    Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now