Setting Up SSH Keys

Sdílet
Vložit
  • čas přidán 19. 09. 2019
  • Are you still using passwords for your SSH sessions? Here's a quick tutorial for increasing your security by setting up key-based authentication instead.
    ---
    Join the Nerd Club: nerdclub.nots.co
    nerdonthestreet.com
    discord.nots.co
    / nerdonthestreet
    / nerdonthestreet
    / nots_network
    E-Mail: jacob@nerdonthestreet.com
  • Věda a technologie

Komentáře • 31

  • @Borsting89
    @Borsting89 Před 4 lety +11

    This is great, thanks for sharing Jacob. I`ve actually been using key authentication for quite a while now since its required for rsync automated backup. For any of you guys watching, key based authentication not only let you secure your server at a higher level, but it is also necessary if you want to run a scheduled cronjob with backup using rsync. It allows for a fully encrypted, very robust backup over the network/internet. Maybe that would be a great follow up video for you, Jacob? And btw, 3:12 is one of the reasons I love this channel.

  • @TheKeule33
    @TheKeule33 Před 4 lety +3

    Thank you.
    For new users like me: when trying to login after the key setup is complete, make sure to login as the same user you setup the keys with. He mentions this, but I was an idiot and tried to login as root.
    Explanation: SSH looks for the key in the users directory /home/USER/.ssh/. When you are root, you use a different home directory, and therefore a different path to ~/.ssh, because roots home is /root/.ssh/

  • @deannalipowicz2862
    @deannalipowicz2862 Před 2 lety

    Thank you for finally explaining what a key is. I literally watched several videos and nobody actually explains the difference between this and a password the way you did.

  • @davids9139
    @davids9139 Před rokem

    Great video! Out of all the videos on the internet, this one helped the most with setting up keys and understanding the finer details. I really appreciate you taking the time to make this video. Thanks Jacob!

  • @paulcodes
    @paulcodes Před 3 lety +4

    Dude this was perfect! Thanks for going through all of the details. It finally clicked for me thanks for your talking through the thought process as well as each step. Thanks for putting this together! Keep it up!

  • @merkin3k
    @merkin3k Před 4 lety +4

    Thanks for doing that extra step and configuring access from a second client. That cleared up something for me that I was just trying to work through last night. 👍

  • @martymccafferty7510
    @martymccafferty7510 Před 4 lety +1

    Glad to see you using ssh keys now. Keys can also be assigned commands on remote sever, and not just the bash shell. I use this so my admins can see results of a command.
    Of couse sshfs is another magical tool to use with ssh to mount a share over ssh.
    There is lots of magic that can be done with ssh.

  • @ProgrammingwithPeter
    @ProgrammingwithPeter Před 4 lety +2

    This is important and useful if you have to do it a lot, in general it's a good practice to use ssh

  • @vincentlaw1016
    @vincentlaw1016 Před 4 lety +2

    Your videos are very informative and easy to understand for linux noobs like myself thanks for posting this.

  • @mrherpes2971
    @mrherpes2971 Před 3 lety +1

    thank you very much, finally after so many years, ssh concept has been made clear!

  • @rcdenis1
    @rcdenis1 Před 4 lety

    Public/private keys made sense to me when someone suggested I think of a lock and its key. The public key is the lock on the server's gate and the private key is my key to open the lock so i can get in. Simple concept. Thanks for the video.

    • @mrherpes2971
      @mrherpes2971 Před 3 lety

      yeah this simple analogy made this concept so simple to understand.

  • @martymccafferty7510
    @martymccafferty7510 Před 4 lety +1

    With Ssh-agent you will only have to type your passphrase once and you will not get prompted again for that key when you ssh again, until you logout of your desktop session, which would end the ssh-agent session.

  • @EnglishRain
    @EnglishRain Před 3 lety

    Excellent tutorial, thank you so much!

  • @hakkadesu1322
    @hakkadesu1322 Před rokem

    Incredibly well explained, thank you very much.

  • @daniellevitski6703
    @daniellevitski6703 Před rokem

    Respect!! One of the best tutorials!

  • @JNET_Reloaded
    @JNET_Reloaded Před 2 lety

    om on a rpi4 running raspbian os for arm and 3cx is onit all working, now i want to put that all as is onto a vmware, the stand alone refuses to connect i tried all kinds root account normal account thats added to sudoers file tried all kinds of ssh keys and nothing connects any ideas? can i just image the sd card and give that img file to vmware and it just work? i thought i could just add the public ssh key from w.e the vmware stand alone crap uses to auth hosts file but i dont know where to find the pubolic key for my windows i can generate 1 but not sure if that works i did try but it failed!

  • @jayleeh65
    @jayleeh65 Před 3 lety

    What if my server is not configured for password authentication and only requires an ssh key authentication? How would I be able to ssh copy the key from my local machine to the remote server without doing the manual copy paste format?

  • @mariadeclaret540
    @mariadeclaret540 Před 2 lety

    Hello, I generated ssh key but I cant find where it is saved, thus unable to log in to the server

  • @user-kv3nt7fc8s
    @user-kv3nt7fc8s Před 7 měsíci

    ssh not working, pleaase help me ..
    /root/.ssh/config: line 2: Bad configuration option: username

  • @eliashckr4913
    @eliashckr4913 Před 4 lety +1

    I want to translate your video, enable the translator option in the video

  • @wolfganggosejacob779
    @wolfganggosejacob779 Před 3 lety

    a mathematical question: can i change the private key and the public key before first usage by changing the filenames? result is that i spread my "private key" and save my "public key".
    the function and security should be the same! or not?

    • @NerdOnTheStreet
      @NerdOnTheStreet  Před 3 lety +1

      The private key and public key use different formats (and the private key is larger.) While it might be acceptable from a security standpoint in some scenarios, I wouldn't expect it to work in practice with most software. There are several good Stack Exchange answers about this if you do a web search for your question.

    • @wolfganggosejacob779
      @wolfganggosejacob779 Před 3 lety

      @@NerdOnTheStreet thank you for explaining the difference. so i can look for the length

  • @m4l490n
    @m4l490n Před 4 lety

    Why are you going to change your file run for nextcloud?

    • @NerdOnTheStreet
      @NerdOnTheStreet  Před 4 lety +2

      Because Nextcloud is open-source. I'm actually not a fan of the Nextcloud developers (they tend to think they "know what's best" for their users), but Filerun being proprietary makes it a stain for me, as well as it works.

    • @lechsiz1642
      @lechsiz1642 Před 2 lety

      @@NerdOnTheStreet How safe is it for me to store a copy of my private SHH key on nextcloud if I use a provider? I rent a room in a house with 2 other roommates and if my PCs/gear were ever stolen, I'd lose the key. granted, my server is a Pi4, so that might get stolen, too. That is one reason I don't want my own Nextcloud on my own server.

  • @Itronyx1cz
    @Itronyx1cz Před rokem +1

    I really don't know what to say, for me the tutorial is complicated, plus I don't understand one thing at 10:50 what is this supposed to be? Entering via root? And also some ip that you didn't even say if it belongs to the server or to the computer it owns. And another thing is that for me it says it found no ERROR No such file? Like doesn't it generate it rather than like search? What is this terminal behavior? All the procedures I tried to do according to the video and I have no other option but to give up and use another server instead of SSH because I really can't do it any other way.

    • @NerdOnTheStreet
      @NerdOnTheStreet  Před rokem

      "at 10:50 what is this supposed to be? Entering via root?" - Yes, that moment is logging into the root account of a server that is still configured with password-based authentication.
      "you didn't even say if it belongs to the server or to the computer it owns." - Servers do not "own" computers. I don't know where you got that idea, because it wasn't from this video. You can also deduce that if I'm on a client computer and I'm SSH'ing into something, it's not the client computer... because why would I SSH into the computer that I'm already on?
      "it found no ERROR No such file?" - It seems like you messed up the formation of this sentence, but you provided an incorrect filename or path to a command if you're seeing that message. If you're sure that the file path is correct, then you may be running a command meant for the client on the server (or vice versa).
      "All the procedures I tried to do according to the video" - You most certainly did not do the procedures according to the video if it's not working. This is a very basic process that doesn't change much between distros or over time.
      "I have no other option but to give up and use another server instead of SSH" - You're going to throw away a physical server because you can't log in with SSH? Or do you mean "use another authentication mechanism," like a password? SSH is extremely common and there are many resources about how to set it up, so please do not insinuate that your failure to follow my tutorial means that I have deprived you of the ability to use a server.

  • @chessgo5028
    @chessgo5028 Před 7 měsíci

    Man it is too technical. I was looking for simpler explanation. dislike.