Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Linux Commands»How to copy a folder from remote to local using SCP

    How to copy a folder from remote to local using SCP

    By RahulJuly 23, 20221 Min Read

    SCP (Secure Copy) is a command line tool for Linux systems for securely transferring files from a remote server to the local system or vice versa. SCP uses SSH protocol for transferring files between two systems which is more secure than FTP.

    Advertisement

    SCP command required the password of the remote system. In case you need to configure scp command in script and run with scheduler, you need to configure key based ssh login.

    • Use the following command to copy the folder from remote to local recursively
      scp -r [email protected]:/path/to/folder /path/to/local 
      
    • In case, SSH is running on a different port, use -P to define port number with the SCP command:
      scp -P 2222 -r [email protected]:/path/to/folder /path/to/local 
      
    • If the authentication is configured with a pem file. you can use the pem as below:
      scp -i auth.pem -r [email protected]:/path/to/folder /path/to/local 
      
    command file transfer linux scp SSH
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    cp Command in Linux (Copy Files Like a Pro)

    dd Command in Linux (Syntax, Options and Use Cases)

    Top 10 JQ Commands Every Linux Developer Should Know

    Add A Comment

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Implementing a Linux Server Security Audit: Best Practices and Tools
    • cp Command in Linux (Copy Files Like a Pro)
    • 15 Practical Examples of dd Command in Linux
    • dd Command in Linux (Syntax, Options and Use Cases)
    • Iptables: Common Firewall Rules and Commands
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.