Results 1 to 8 of 8
  1. #1
    Join Date
    Mar 2008
    Posts
    372

    need help with ssh file tranfer command

    I would need help with ssh file tranfer command, I am not sure how to use command when a custom ports are used

    I have to move 2 files from a site which has port as 101 to the site which has the default port of 22

    plz help with example and syntax
    thanks

  2. #2
    You can use scp or ftp. scp can be the best to use its copy using ssh and would me more secure than ftp.

    For example :

    $ scp source/file.c [email protected]:remote/dir
    $ scp -r [email protected]:remote/dir ~/tmp

    for more help you can refer the man pages for good descriptions.
    Support Facility | 24/7 web hosting technical support services
    Technical support | Server management | Data migration

    Technical Articles

  3. #3
    Join Date
    Jul 2009
    Posts
    178
    scp -r <directory name> ssh -p <port number> [email protected]:/path/

  4. #4
    Quote Originally Posted by koolnhot View Post
    I would need help with ssh file tranfer command, I am not sure how to use command when a custom ports are used

    I have to move 2 files from a site which has port as 101 to the site which has the default port of 22

    plz help with example and syntax
    thanks
    Login to the source server and execute the following commands:

    rsync -vrplogDtH -e "ssh -p 22" /path/to/source/file [email protected]:/path/to/directory/

    scp is also fine but the copy starts all over again if it get disconnects midway. rsync will start where it left from.
    | LinuxHostingSupport.net
    | Server Setup | Security | Optimization | Troubleshooting | Server Migration
    | Monthly and Task basis services.
    | MSN : madaboutlinux[at]hotmail.com | Skype : madaboutlinux

  5. #5
    Join Date
    Mar 2008
    Posts
    372
    hi mate I get tht but how to use if I have to move the file from port 101 to port 22, any specific syntax to be used ??
    as I should be logged into port22 vps to dld the file rite

  6. #6
    Join Date
    Mar 2008
    Posts
    372
    actually I have to copy the files and extract them, they are 2 tar files, I am moving files to new host, so if I use rsync then it might be in compressed mode rite, then how to make it to normal tar file to un-tar it

  7. #7
    Quote Originally Posted by koolnhot View Post
    actually I have to copy the files and extract them, they are 2 tar files, I am moving files to new host, so if I use rsync then it might be in compressed mode rite, then how to make it to normal tar file to un-tar it
    It doesn't matter what SSH port you have on the source server unless you are executing the command from the source server itself. You have to mention the port of the server you are connecting to which is 22.

    Yes, rsync will copy a tar file as it is so do scp. Once you migrate the contents, you have to untar the files on the destination server using the untar command

    untar filename.tar
    | LinuxHostingSupport.net
    | Server Setup | Security | Optimization | Troubleshooting | Server Migration
    | Monthly and Task basis services.
    | MSN : madaboutlinux[at]hotmail.com | Skype : madaboutlinux

  8. #8
    Join Date
    Mar 2008
    Posts
    372
    so rsync and scp are used in same way ?? As I am not much familiar with ssh codes,
    if I use rsync, I have to use same ssh window rite i.e putty and give following command:

    rsync -vrplogDtH -e "ssh -p 22" /home/admin/public_html/srs/s1.tar.gz [email protected]:/home/domains/admin/public_html/srs/

    is there any thing wrong with my command execution ? if yes plz let me know so that I can rectify it

Similar Threads

  1. File details command
    By GeXus in forum Hosting Security and Technology
    Replies: 4
    Last Post: 01-14-2008, 02:34 PM
  2. file limit & http tranfer limit
    By variable in forum Hosting Security and Technology
    Replies: 1
    Last Post: 01-22-2006, 09:05 PM
  3. Running an exe file from shell command
    By dscg in forum Hosting Security and Technology
    Replies: 4
    Last Post: 01-17-2005, 06:14 AM
  4. what is the command to send a file?
    By athlonkmf in forum Programming Discussion
    Replies: 4
    Last Post: 04-24-2004, 02:34 AM
  5. Linux command/script to run a command for every file in a directory tree?
    By civ in forum Hosting Security and Technology
    Replies: 5
    Last Post: 01-25-2004, 08:48 PM

Posting Permissions

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