SSH server to server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • GFED
    Confirmed User
    • May 2002
    • 8121

    #1

    SSH server to server

    oki...

    How do I transfer a file from one server to another using SSH?

    With FTP I can use the get or put command...

    But when I SSH into my server I don't have this command...

    https://www.flow.page/savethechildren
  • zagi
    Confirmed User
    • Jan 2004
    • 1238

    #2
    from ssh you can do :


    ftp new-host-name.com

    and use regular ftp


    -OR-

    scp local_file user@remotebox:/dir/to/place/file/in
    Managed US/NL Hosting [ [Reality Check Network ]
    Dell XEON Servers + 1/2/3 TB Packages ICQ: 4-930-562

    Comment

    • JulianSosa
      Confirmed User
      • Aug 2003
      • 3042

      #3
      fetch

      Comment

      • SeTec
        Confirmed User
        • May 2004
        • 440

        #4
        why use ssh then ftp? kinda defeats the purpose. use sftp or scp. type man sftp or scp for more info
        ICQ # 916111

        Comment

        • Nasty
          Confirmed User
          • Aug 2002
          • 1575

          #5
          This will transfer a file or a whoel directory tree, just execute it from the directory you are wanting to cop to the second server and have your root password the second machineready

          tar cpf - . | ssh [email protected] 'cd /path/on/new/server; tar xvf -'

          “Ours is a world of nuclear giants and ethical infants. We know more about war than we know about peace, more about killing than we know about living. If we continue to develop our technology without wisdom or prudence, our servant may prove to be our executioner.” ― Omar Bradley (1948)

          Comment

          • raymor
            Confirmed User
            • Oct 2002
            • 3745

            #6
            For one file you may well have a command named
            GET (capitalized).
            You can also use wget:
            wget ftp://user:[email protected]/dirr/file.zip

            There are also likely comands named "ftp" and "ncftp",
            but you'll need to know a few FTP commands to use them.
            ncftp is better and easier, if it's available.
            If you're transferring a lot of files, you can use a tar pipe (below).
            If you're transferring EVERYTHING, like moving from one
            dedicated server to another, you'll need to do more than
            just move files and having a pro handle it can save you
            not only a lot of hassle but also a lot of money (downtime, etc.)

            I've probably moved people from one server to another
            100 times and I STILL carefully follow a written checklist
            because without it I would miss things and there would
            be probems. For example, if I forgot to set the DNS TTL
            48 hours before the move new members may not be able
            to access the site for the first couple of days of their
            membership and expiring members may live on forever on
            the new server.

            Anyway, a tar pipe to copy a directory:

            copy from here to there:
            cd /home
            tar --gzip --sparse --preserve --same-owner --atime-preserve -B -cvf - . |
            ssh user@host "cd /home; tar -B --ungzip --preserve --same-owner --atime-preserve --sparse -xvf -"


            copy to me:
            ssh -l root otherserver.com "cd /home/user/somedir; tar -B --gzip --preserve
            --same-owner --atime-preserve --sparse -cvf - ." | tar --ungzip --preserve -B
            --same-owner --atime-preserve --sparse -xvf -
            For historical display only. This information is not current:
            support@bettercgi.com ICQ 7208627
            Strongbox - The next generation in site security
            Throttlebox - The next generation in bandwidth control
            Clonebox - Backup and disaster recovery on steroids

            Comment

            • GFED
              Confirmed User
              • May 2002
              • 8121

              #7
              Thanks!

              https://www.flow.page/savethechildren

              Comment

              • blazin
                Confirmed User
                • Aug 2002
                • 2781

                #8
                easier method:

                scp localfile [email protected]:/home/remoteuser/
                I don't endorse a god damn thing......

                Comment

                Working...