Name: Towards AI Legal Name: Towards AI, Inc. Description: Towards AI is the world's leading artificial intelligence (AI) and technology publication. Read by thought-leaders and decision-makers around the world. Phone Number: +1-650-246-9381 Email: [email protected]
228 Park Avenue South New York, NY 10003 United States
Website: Publisher: https://towardsai.net/#publisher Diversity Policy: https://towardsai.net/about Ethics Policy: https://towardsai.net/about Masthead: https://towardsai.net/about
Name: Towards AI Legal Name: Towards AI, Inc. Description: Towards AI is the world's leading artificial intelligence (AI) and technology publication. Founders: Roberto Iriondo, , Job Title: Co-founder and Advisor Works for: Towards AI, Inc. Follow Roberto: X, LinkedIn, GitHub, Google Scholar, Towards AI Profile, Medium, ML@CMU, FreeCodeCamp, Crunchbase, Bloomberg, Roberto Iriondo, Generative AI Lab, Generative AI Lab Denis Piffaretti, Job Title: Co-founder Works for: Towards AI, Inc. Louie Peters, Job Title: Co-founder Works for: Towards AI, Inc. Louis-François Bouchard, Job Title: Co-founder Works for: Towards AI, Inc. Cover:
Towards AI Cover
Logo:
Towards AI Logo
Areas Served: Worldwide Alternate Name: Towards AI, Inc. Alternate Name: Towards AI Co. Alternate Name: towards ai Alternate Name: towardsai Alternate Name: towards.ai Alternate Name: tai Alternate Name: toward ai Alternate Name: toward.ai Alternate Name: Towards AI, Inc. Alternate Name: towardsai.net Alternate Name: pub.towardsai.net
5 stars – based on 497 reviews

Frequently Used, Contextual References

TODO: Remember to copy unique IDs whenever it needs used. i.e., URL: 304b2e42315e

Resources

Take our 85+ lesson From Beginner to Advanced LLM Developer Certification: From choosing a project to deploying a working product this is the most comprehensive and practical LLM course out there!

Publication

How to use the SCP Command for File Transfer
Latest   Machine Learning

How to use the SCP Command for File Transfer

Last Updated on July 20, 2023 by Editorial Team

Author(s): Garima Nishad

Originally published on Towards AI.

Using File Transfer on Linux U+007C Towards AI

SCP (secure copy) command in Linux can be confusing, let me make this a bit easier for you

In this blog post, I’m going to show you how you can use the SCP command to copy your files or directories from your local machine to a remote server. So let’s say I have a remote server( shown below):

This one is my local machine,

Now let’s say and I want to transfer the file from my local machine to a remote server. So, first of all, let’s see what are the options we have with the SCP command by typing β€œscp” in the terminal.

This will show you all the options which you can use with the SCP:

As documentation states that

  • -c cipher
    Selects the cipher to use for encrypting the data transfer. This option is directly passed to ssh(1).
  • -F ssh_config
    Specifies an alternative per-user configuration file for ssh. This option is directly passed to ssh(1).
  • -i identity_file
    Selects the file from which the identity (private key) for public-key authentication is read. This option is directly passed to ssh(1).
  • l limit
    Limits the used bandwidth, specified in Kbit/s.
  • -o ssh_option
    It can be used to pass options to ssh in the format used in ssh_config.

We may not use all these complex commands if we simply want to transfer the file. In that case, we just need to give the username and the host IP and then the file name.
For example, let’s say I have a folder called β€œidd” in one of my Desktop folders.

So I’m going to just CD to my folder first of all and then I will transfer this idd folder to the server from my home directory.

So I have a folder named β€œidd1” which I’m gonna copy to the remote server.

so we will use an SCP command and the IP of this remote server so to know the IP of the remote server you just say if config and then press enter

The IP address of the remote server is the one written right beside β€œinet” and then we also need the user so username in my case is β€œgarima” which can be different in your case.

So now in your SCP command write your file name, so just give the file name in my case its β€œidd” and then the hostname which is β€œgarima” in my case and then @ the IP address of the remote server.

Please note that if your file is a normal file you don’t need to add -r , it is only used for copying folder or directory

So, in whatever folder you want to transfer your files you just need to give the path of that after the colon (:) so, for example, I want to just transfer my files to the alice directory, then press enter.

scp -r idd1 [email protected]:/home/garima/alice

For the first time, it will ask you β€œare you sure you want to continue connecting?” you can just say yes for the first time and then press ENTER and then it’s going to need your remote server's password so the password you use to log into this remote server. Just enter your password then this file would be transferred.

There you have it, your files will be transferred in a flash.

Join thousands of data leaders on the AI newsletter. Join over 80,000 subscribers and keep up to date with the latest developments in AI. From research to projects and ideas. If you are building an AI startup, an AI-related product, or a service, we invite you to consider becoming aΒ sponsor.

Published via Towards AI

Feedback ↓