Author : Piyush Gupta
SCP (Secure Copy) is a command line tool for Linux systems for securely transfer files from local to remote server or vice a versa. SCP uses SSH protocol for transferring files between two systems which is more secure than ftp.
SCP (Secure Copy) is a command line tool for Linux systems for securely transfer files from local to remote server or vice a versa. SCP uses SSH protocol for transferring files between two systems which is more secure than ftp.
- Syntax: (Local to Remote)
- Syntax: (Remote to Local)
Transfer File Local to Remote Server
Following command will copy myfile.txt from current directory of local system to remote server’s /opt directory using root authentication. We are assuming remote server hostname is example.com.Transfer File Remote Server to Local
Following command will copy /opt/myfile.txt from remote system to local system’s /opt directory.Define Port with SCP Command
In case SSH is running on different port on remote server, use -P switch followed by port number with scp command.
Transfer Directory Local to Remote Server Recursively
Following command will copy /opt/mydir directory from local system to remote system’s /opt directory recursively.Transfer Directory Remote Server to Local Recursively
Following command will copy /opt/mydir directory from remote system to remote system’s /opt directory recursively.
No comments:
Post a Comment