+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 18

Thread: Putty to transfer files from one server to another

  1. #1
    Join Date
    2007 Aug
    Posts
    41

    Putty to transfer files from one server to another

    Just wondering if someone could help me out with this one..

    I want to transfer files from one server hosted with another company to my server hosted with serverbeach. I know that you can connect to 2 different servers and transfer files but I am not sure how it is done.

    Could someone help me out with the putty commands??

    I need to make sure the file structure is kept and file permissions are also kept.

    Thanks

  2. #2
    Join Date
    2003 Jul
    Posts
    4,751
    This should give you quite a bit of info regarding PuTTY.

    http://www.chiark.greenend.org.uk/~s...putty/faq.html

  3. #3
    Join Date
    2005 Oct
    Location
    San Antonio, TX
    Posts
    409
    If by PuTTy commands you mean SSH commands, then scp and sftp are probably the commands you want to use. I prefer scp myself.

    http://en.wikipedia.org/wiki/Secure_copy

  4. #4
    Join Date
    2007 Aug
    Posts
    41
    Thanks for the info... When I transferred the files originally to our new hosted server I downloaded them to my desktop from the old host then uploaded them to the serverbeach server. We use a program and the folder permissions got changed, way to many folders to reset permissions to.

  5. #5
    Join Date
    2005 Oct
    Location
    San Antonio, TX
    Posts
    409
    Quote Originally Posted by beachbum
    Thanks for the info... When I transferred the files originally to our new hosted server I downloaded them to my desktop from the old host then uploaded them to the serverbeach server. We use a program and the folder permissions got changed, way to many folders to reset permissions to.
    Using tar is generally the best way to save permissions when backing stuff up. Just use -p to preserve premissions.

  6. #6
    Join Date
    2007 Aug
    Posts
    41
    I think I have read just about everything and I am still lost. I down loaded this program called secpanel but I don't even know how to install it.

  7. #7
    Join Date
    2003 Jul
    Posts
    4,751
    Hmm... GUI for managing and running ssh and related utilities.

    http://www.freshports.org/security/secpanel/

  8. #8
    Join Date
    2005 Dec
    Location
    Texas
    Posts
    160
    I installed secpanel, but I'm not sure it is particulary useful in this situation.

    Here's a scenario you might use to copy files from one remote server to the other.
    • Use PuTTY to log into the first server.
    • Switch to root and use tar to archive the files/filesystem into one file, ie. /var/www/html/data to data.tar .
      Code:
      :~$ su - 
      Enter root password when prompted.
      :~$ cd /var/www/html/
      :~$ tar -cvvf data.tar data
    • Use SCP to copy the archive to the second server.
      Code:
      :~$ scp data.tar user2@server2.com: (don't forget the trailing ":")
      Enter user2's password when prompted.
      This will copy the archive to user2's home directory
    • Use PuTTY, or ssh directly from server1, to log into server2 and untar the archive in /var/www/html/
      Code:
      :~$ ssh user2@server2.com
      Enter user2's password when prompted.
      :~$ su - 
      Enter root password when prompted.
      :~$ cd /var/www/html/
      :~$ mv /home/user2/data.tar . (don't forget that ".")
      :~$ tar -pxvf data.tar
    • Done!
    I hope this helps. If your getting stuck at a certain step, let us know.

  9. #9
    Join Date
    2007 Aug
    Posts
    41
    I am trying your suggestion now!!!

    I was able to install the rpm package of secpanel but when I run the command
    "whereis wish" and copy the location to line one of the secpanel file it just returns an error

    This is the location that I get for the wish location
    wish: /usr/bin/wish /usr/bin/wish8.4 /usr/share/man/man1/wish.1.gz

    This is what line 1 of the secpanel file reads

    #!/bin/sh
    # -*- tcl -*-
    # Executing wish #\
    exec wish "/usr/bin/wish"


    the error that I get is

    Application initialization failed: no display name and no $DISPLAY environment variable
    Error in startup script: invalid command name ELF4Ü4"
    while executing
    ELF4Ü4 (4àà..."

  10. #10
    Join Date
    2007 Aug
    Posts
    12
    Quote Originally Posted by beachbum
    I am hung up on this step

    tar -cvvf data.tar data

    what I entered and got

    [admin@dedicated html]$ tar -cvvf sugarcrm2.tar sugarcrm2
    tar: sugarcrm2.tar: Cannot open: Permission denied
    tar: Error is not recoverable: exiting now
    You may not have permissions to access the file unless you are running as root. What does ls -al sugarcrm* come back with permissions-wise?

  11. #11
    Join Date
    2007 Aug
    Posts
    41
    yea.. thought I was logged in as root.. guess not

    on to step 2..

  12. #12
    Join Date
    2007 Aug
    Posts
    12

    Wink

    Quote Originally Posted by beachbum
    yea.. thought I was logged in as root.. guess not

    on to step 2..
    Usually you'd never log-on via any method as a root user, you'll only switch to perform a very specific task and then drop back down to user-mode permissions. I don't know if they enforce that as a rule here, but take it from me, Linux, and most Unices will not tell root no for any reason. I've taken more on the chin logging in as root and user that as a user account than I care to think about, so I hope that it is a policy that's enforced.

  13. #13
    Join Date
    2007 Aug
    Posts
    41
    step 2... can't get past the password.. I have tried 3 account names


    scp data.tar chris@mywebsite.com::

    chris is an account that I had setup.. now I can ftp a file using that account


    worked with the primary userid and the server IP address but not the @mywebsite.com:
    Last edited by beachbum; 2007-08-14 at 17:39 PM.

  14. #14
    Join Date
    2007 Aug
    Posts
    12
    Quote Originally Posted by beachbum
    step 2... can't get past the password.. I have tried 3 account names


    scp data.tar chris@solidvision.com:

    chris is an account that I had setup.. now I can ftp a file using that account
    If you can use FTP to move the file, it SHOULDN'T hurt anything to use that method, it's simply not an encrypted transmission like scp (secure copy) is. If you feel comfortable with your data being exposed to the world (potentially), then FTP is a great way to move the data, otherwise, I'd log in with a shell to "server2", make sure my password is right with the "passwd" command, and retry the transfer

  15. #15
    Join Date
    2007 Aug
    Posts
    41
    got it to work but this happened

    data.tar 50% 152MB 0.0KB/s - stalled -

    so what happened??

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts