![]() ![]() Using the SCP command with SSH keyĪn SSH key is one of the most secure ways to access a server through SSH. Scp -P 8984 $HOME/Desktop/webapp.zip command will ask for the password associated with the server user and proceed to the copy if valid. The folder directory in the remote server where the file will be copiedįor the use case we defined early, this is the command to execute: The remote server port It is not required and must be used only if you changed the default SSH port (22) The path of the file on your local computer The command template for a copy from a local machine to a remote server is the following: SCP is the CLI command we use to perform copy over SSH. We cannot use $HOME because it will be interpreted as the home folder on the local computer. The symbol ~ represents the user's home folder on the remote server. In this scenario, you have a file on your local computer you want to copy to the server for a particular use case. Copying files from local machine to remote machine Use my referral link to get €20 after you sign up. The server running this blog and all my side projects are hosted here. You can buy a VPS on Hetzner, which provides affordable servers with good performance. ![]() If you are on Windows, install an SSH client such as Putty or use the WSL. ![]() You will need a computer running on a UNIX system (Any Linux distribution or MacOS) to follow this tutorial. In this post, we will see how to transfer files via SSH. Update the application configuration file running on a remote server.Pull logs for a running application in production.Backup application data to another server.Here are some use cases for copying files: You may be wondering what could the requirement is for that. This requires performing some manipulations and copying files from one server to another. Other developers manage them manually to deploy applications, test networking features, host a personal blog, etc. In the Era of cloud and managed services where developers focus on their code, and the infrastructure part is managed by various tools and services. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |