How do I set up my SSH keys so I can copy files from my local PC to a remote shared server?












1














I want to start using SSH instead of FTP, but I am clueless when it comes to SSH keys.



I'd like to use a Gulp command to transfer my files (as I do now with FTP). I've found a good amount of NPM packages that do this. However, none explain how to actually set up SSH keys on my remote shared (LAMP) server and on my local machine (MacOS).



Would anyone know how to set this up? All the tutorials I've found deal with setting up the node.js package, not the SSH keys themselves.










share|improve this question





























    1














    I want to start using SSH instead of FTP, but I am clueless when it comes to SSH keys.



    I'd like to use a Gulp command to transfer my files (as I do now with FTP). I've found a good amount of NPM packages that do this. However, none explain how to actually set up SSH keys on my remote shared (LAMP) server and on my local machine (MacOS).



    Would anyone know how to set this up? All the tutorials I've found deal with setting up the node.js package, not the SSH keys themselves.










    share|improve this question



























      1












      1








      1







      I want to start using SSH instead of FTP, but I am clueless when it comes to SSH keys.



      I'd like to use a Gulp command to transfer my files (as I do now with FTP). I've found a good amount of NPM packages that do this. However, none explain how to actually set up SSH keys on my remote shared (LAMP) server and on my local machine (MacOS).



      Would anyone know how to set this up? All the tutorials I've found deal with setting up the node.js package, not the SSH keys themselves.










      share|improve this question















      I want to start using SSH instead of FTP, but I am clueless when it comes to SSH keys.



      I'd like to use a Gulp command to transfer my files (as I do now with FTP). I've found a good amount of NPM packages that do this. However, none explain how to actually set up SSH keys on my remote shared (LAMP) server and on my local machine (MacOS).



      Would anyone know how to set this up? All the tutorials I've found deal with setting up the node.js package, not the SSH keys themselves.







      ftp ssh gulp






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 1 hour ago









      Stephen Ostermiller

      66.7k1391244




      66.7k1391244










      asked 1 hour ago









      MeltingDog

      66111428




      66111428






















          1 Answer
          1






          active

          oldest

          votes


















          2















          • Perhaps, this article might interest you. However, before following this article, it would be nice to setup the SSH trust first.

          • So, the problem statement is, you want to copy some files from your local machine to a remote server.

          • To do that, you have to first chose an authentication method. Assuming the remote server is Linux, you've got two options - Password based and Password Less a.k.a SSH Key based authentication.

          • For the remote server to authenticate you, these are the steps which need to happen

          • You create an SSH keypair (Private Key + Public Key) on your local machine.

          • You just copy/append the contents public key from your local machine to the .ssh/authorized_keys file of the remote server.

          • Now, when you will try to SSH to the remote server from your local machine, you will specify in the command that you are trying to authenticate with the private key file that you already have created in the first step and the authentication will be successful since you have imported the corresponding public key to the remote server's authorized_keys file.


          • First, lets create keypair:
            ssh-keygen -t rsa and then select all default options by just pressing Enter key.


          • In the output of the above command, you will see that the private and public key files will be generated e.g.:
            Your identification has been saved in /home/ec2-user/.ssh/id_rsa
            Your public key has been saved in /home/ec2-user/.ssh/id_rsa.pub

          • Now, just copy/append the id_rsa.pub's CONTENT file from the directory mentioned in your case to the ~/.ssh/authorized_keys.

          • To confirm that the SSH trust has been established, just try to SSH from your local machine to the remote server by using this command - ssh -i /location/of/private/key username@remote_server_ip

          • If everything's good and you are able to login, then you just have to follow the link I mentioned in the first line of this post.






          share|improve this answer










          New contributor




          st_rt_dl_8 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.


















            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "45"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fwebmasters.stackexchange.com%2fquestions%2f119945%2fhow-do-i-set-up-my-ssh-keys-so-i-can-copy-files-from-my-local-pc-to-a-remote-sha%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            2















            • Perhaps, this article might interest you. However, before following this article, it would be nice to setup the SSH trust first.

            • So, the problem statement is, you want to copy some files from your local machine to a remote server.

            • To do that, you have to first chose an authentication method. Assuming the remote server is Linux, you've got two options - Password based and Password Less a.k.a SSH Key based authentication.

            • For the remote server to authenticate you, these are the steps which need to happen

            • You create an SSH keypair (Private Key + Public Key) on your local machine.

            • You just copy/append the contents public key from your local machine to the .ssh/authorized_keys file of the remote server.

            • Now, when you will try to SSH to the remote server from your local machine, you will specify in the command that you are trying to authenticate with the private key file that you already have created in the first step and the authentication will be successful since you have imported the corresponding public key to the remote server's authorized_keys file.


            • First, lets create keypair:
              ssh-keygen -t rsa and then select all default options by just pressing Enter key.


            • In the output of the above command, you will see that the private and public key files will be generated e.g.:
              Your identification has been saved in /home/ec2-user/.ssh/id_rsa
              Your public key has been saved in /home/ec2-user/.ssh/id_rsa.pub

            • Now, just copy/append the id_rsa.pub's CONTENT file from the directory mentioned in your case to the ~/.ssh/authorized_keys.

            • To confirm that the SSH trust has been established, just try to SSH from your local machine to the remote server by using this command - ssh -i /location/of/private/key username@remote_server_ip

            • If everything's good and you are able to login, then you just have to follow the link I mentioned in the first line of this post.






            share|improve this answer










            New contributor




            st_rt_dl_8 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.























              2















              • Perhaps, this article might interest you. However, before following this article, it would be nice to setup the SSH trust first.

              • So, the problem statement is, you want to copy some files from your local machine to a remote server.

              • To do that, you have to first chose an authentication method. Assuming the remote server is Linux, you've got two options - Password based and Password Less a.k.a SSH Key based authentication.

              • For the remote server to authenticate you, these are the steps which need to happen

              • You create an SSH keypair (Private Key + Public Key) on your local machine.

              • You just copy/append the contents public key from your local machine to the .ssh/authorized_keys file of the remote server.

              • Now, when you will try to SSH to the remote server from your local machine, you will specify in the command that you are trying to authenticate with the private key file that you already have created in the first step and the authentication will be successful since you have imported the corresponding public key to the remote server's authorized_keys file.


              • First, lets create keypair:
                ssh-keygen -t rsa and then select all default options by just pressing Enter key.


              • In the output of the above command, you will see that the private and public key files will be generated e.g.:
                Your identification has been saved in /home/ec2-user/.ssh/id_rsa
                Your public key has been saved in /home/ec2-user/.ssh/id_rsa.pub

              • Now, just copy/append the id_rsa.pub's CONTENT file from the directory mentioned in your case to the ~/.ssh/authorized_keys.

              • To confirm that the SSH trust has been established, just try to SSH from your local machine to the remote server by using this command - ssh -i /location/of/private/key username@remote_server_ip

              • If everything's good and you are able to login, then you just have to follow the link I mentioned in the first line of this post.






              share|improve this answer










              New contributor




              st_rt_dl_8 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.





















                2












                2








                2







                • Perhaps, this article might interest you. However, before following this article, it would be nice to setup the SSH trust first.

                • So, the problem statement is, you want to copy some files from your local machine to a remote server.

                • To do that, you have to first chose an authentication method. Assuming the remote server is Linux, you've got two options - Password based and Password Less a.k.a SSH Key based authentication.

                • For the remote server to authenticate you, these are the steps which need to happen

                • You create an SSH keypair (Private Key + Public Key) on your local machine.

                • You just copy/append the contents public key from your local machine to the .ssh/authorized_keys file of the remote server.

                • Now, when you will try to SSH to the remote server from your local machine, you will specify in the command that you are trying to authenticate with the private key file that you already have created in the first step and the authentication will be successful since you have imported the corresponding public key to the remote server's authorized_keys file.


                • First, lets create keypair:
                  ssh-keygen -t rsa and then select all default options by just pressing Enter key.


                • In the output of the above command, you will see that the private and public key files will be generated e.g.:
                  Your identification has been saved in /home/ec2-user/.ssh/id_rsa
                  Your public key has been saved in /home/ec2-user/.ssh/id_rsa.pub

                • Now, just copy/append the id_rsa.pub's CONTENT file from the directory mentioned in your case to the ~/.ssh/authorized_keys.

                • To confirm that the SSH trust has been established, just try to SSH from your local machine to the remote server by using this command - ssh -i /location/of/private/key username@remote_server_ip

                • If everything's good and you are able to login, then you just have to follow the link I mentioned in the first line of this post.






                share|improve this answer










                New contributor




                st_rt_dl_8 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.










                • Perhaps, this article might interest you. However, before following this article, it would be nice to setup the SSH trust first.

                • So, the problem statement is, you want to copy some files from your local machine to a remote server.

                • To do that, you have to first chose an authentication method. Assuming the remote server is Linux, you've got two options - Password based and Password Less a.k.a SSH Key based authentication.

                • For the remote server to authenticate you, these are the steps which need to happen

                • You create an SSH keypair (Private Key + Public Key) on your local machine.

                • You just copy/append the contents public key from your local machine to the .ssh/authorized_keys file of the remote server.

                • Now, when you will try to SSH to the remote server from your local machine, you will specify in the command that you are trying to authenticate with the private key file that you already have created in the first step and the authentication will be successful since you have imported the corresponding public key to the remote server's authorized_keys file.


                • First, lets create keypair:
                  ssh-keygen -t rsa and then select all default options by just pressing Enter key.


                • In the output of the above command, you will see that the private and public key files will be generated e.g.:
                  Your identification has been saved in /home/ec2-user/.ssh/id_rsa
                  Your public key has been saved in /home/ec2-user/.ssh/id_rsa.pub

                • Now, just copy/append the id_rsa.pub's CONTENT file from the directory mentioned in your case to the ~/.ssh/authorized_keys.

                • To confirm that the SSH trust has been established, just try to SSH from your local machine to the remote server by using this command - ssh -i /location/of/private/key username@remote_server_ip

                • If everything's good and you are able to login, then you just have to follow the link I mentioned in the first line of this post.







                share|improve this answer










                New contributor




                st_rt_dl_8 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.









                share|improve this answer



                share|improve this answer








                edited 1 hour ago









                Stephen Ostermiller

                66.7k1391244




                66.7k1391244






                New contributor




                st_rt_dl_8 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.









                answered 1 hour ago









                st_rt_dl_8

                212




                212




                New contributor




                st_rt_dl_8 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.





                New contributor





                st_rt_dl_8 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.






                st_rt_dl_8 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Webmasters Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fwebmasters.stackexchange.com%2fquestions%2f119945%2fhow-do-i-set-up-my-ssh-keys-so-i-can-copy-files-from-my-local-pc-to-a-remote-sha%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Morgemoulin

                    Scott Moir

                    Souastre