Configuring Passwordless Server Login Using SSH

Поделиться
HTML-код
  • Опубликовано: 30 ноя 2024

Комментарии • 66

  • @lautaropastorino4417
    @lautaropastorino4417 4 года назад +19

    Dude you make evereything so clear, keep up the good work!

  • @rodrigocorrea6348
    @rodrigocorrea6348 4 года назад +7

    This is called: Public Service
    Thanks EngineerMan!

  • @marv.hamburg
    @marv.hamburg 3 года назад +1

    You still can do automated things while your private key is secured by a password. Take a look at ssh-agent and ssh-add. Just start ssh-agent and add your key with ssh-add, you will need to enter your password one time and after that there's no need to re-enter.

  • @funkykong9001
    @funkykong9001 4 года назад +16

    I recommend using ed25519 instead of RSA when generating keys. ed25519 keys are smaller and faster and provide just as much security as large RSA keys.
    +1 to using ssh-copy-id to automate getting your pubkey on the remote host.

    • @rtynski
      @rtynski 4 года назад +1

      ssh-copy-id

    • @IgnoreMyChan
      @IgnoreMyChan 4 года назад +1

      ed25519 is really convenient, although not yet globally supported. But I prefer them above RSA.

    • @hardcoreteunes
      @hardcoreteunes 4 года назад

      thanks for the tip!

  • @chairlovawitabat
    @chairlovawitabat 4 года назад +1

    Thank you so much for this video. I really needed this. I’ve been looking for a video that explained how to configure the server ssh and where the public key went. You explained it perfectly.

  • @ZacKoch
    @ZacKoch 4 года назад

    Nice and clear 👍 funny I was just talking about having to log in via the cloud console and manually add new keys because the old ones were lost to a bunch of servers by someone... 🤦‍♂️🤣

  • @jeffherdzina6716
    @jeffherdzina6716 4 года назад +9

    Interesting that you should have this video today. As I've been updating ssh keys on multiple servers, this morning.
    Why may you ask was I changing ssh keys?
    Good question. I was checking my secure logs and found a TON of IP address trying to hack my server. Now my router port for SSH is NO where near port 22. With 65,000+ ports to choose from, they spent the time hunting for the SSH port on my Router.
    Root login is turned off, which is the only account they tried to log into....thank goodness. Checking the IP address out, they all came back from China.

    • @macethorns1168
      @macethorns1168 3 года назад

      Security by obscurity is *not* security. Changing the port just makes it annoying for legitimate users.

    • @jeffherdzina6716
      @jeffherdzina6716 3 года назад

      @@macethorns1168 I have no one from China that should be on these servers. Or for that matter, outside of the U.S.

  • @pr0d1g1
    @pr0d1g1 3 года назад

    This is best explanation i ever get on SSH. I learned many things from you.
    Thanks man

  • @AlfieVLOG0
    @AlfieVLOG0 3 года назад +1

    Is it bad practice to use the same key pair for multiple machines?? Also thanks for the video!!

  • @tech-daddy
    @tech-daddy 3 года назад +1

    Great guide, simple and well explained.

  • @eputen
    @eputen 4 года назад

    Damn. Gotta go and change my server password 🤣. Great video man

  • @ro55mo22
    @ro55mo22 4 года назад +1

    I always adjust the port SSH uses on my servers to something between 64000 and 65000 as well as using SSH keys. Just one more little thing to keep things a bit safer.

    • @macethorns1168
      @macethorns1168 3 года назад

      It really doesn't. Just makes the port scanner take slightly longer and inconveniences actual users.

  • @trashchris
    @trashchris 4 года назад

    I would use an ed25519 key with a password, these days there is no excuse to not have a good secure password and keep it safe.if you need to use multiple loggings with that key in one day you can load it into a key agent on Windows or Linux

  • @jonasbergkvist6381
    @jonasbergkvist6381 4 года назад

    Great vid, follow it up with key management please!

  • @sunwire
    @sunwire 4 года назад

    You can use ssh-audit github.com/jtesta/ssh-audit to auditing/hardening ssh server

  • @Codester145
    @Codester145 4 года назад +1

    Great video as always! Glad to see more Linux content.

  • @mansourq6512
    @mansourq6512 4 года назад

    You are doing great job sir, thank you so much and please keep up ...THUMBS up as usual

  • @williamb.2031
    @williamb.2031 4 года назад

    Awesome stuff as always! Thanks :)

  • @stalebread7972
    @stalebread7972 4 года назад

    Great video, lots to learn

  • @LordHog
    @LordHog 4 года назад

    If you have multiple computer, at home, would you generally create ssh key pairs for each computer that is accessing some remote machine or share a common ssh key pair between all the machines that will access the remote machine?

    • @EngineerMan
      @EngineerMan  4 года назад +1

      You could do either, my preference is to make each computer have its own pair.

  • @lakshyajain3715
    @lakshyajain3715 4 года назад +1

    CAN YOU PLEASE MAKE A VIDEO ON ATOM PACKAGES YOU HAVE INSTALLED FOR HTML(LIKE THAT ATTRIBUTE COMPLETION MENU)? I NEED THEM FOR AN UPCOMING EXAM

    • @EngineerMan
      @EngineerMan  4 года назад +1

      As far as I know that's built into Atom. I don't recall installing anything to get that.

    • @lakshyajain3715
      @lakshyajain3715 4 года назад

      @@EngineerMan thanks for your reply. :)

  • @CamStansell
    @CamStansell 4 года назад

    brilliant. thanks

  • @bordertone_5138
    @bordertone_5138 3 года назад

    Thank you so much

  • @biniesh7097
    @biniesh7097 4 года назад

    thanks for simplifiying

  • @speedibusrex
    @speedibusrex 4 года назад +1

    Install fail2ban to block SSH spammers.

    • @macethorns1168
      @macethorns1168 3 года назад

      You can also use iptables to throttle connection attempts from source IPs. You really can't go wrong with that.

  • @macethorns1168
    @macethorns1168 3 года назад

    Haven't finished the video yet, but your authorized_keys file can't be allowed to be read by other users or it won't work.

  • @Ebbzzor
    @Ebbzzor 4 года назад +1

    If your developer machine gets stolen/broken after disabling pw. Are you forever locked out assuming you just set up that 1 ssh?

    • @SuperMuchonacho
      @SuperMuchonacho 4 года назад +1

      Ebbzzor no - disabling passwords in sshd only disables passwords for ssh connections, it doesn’t change local sign in - so If you have the machine locally you can still sign in normally as you would with any pc, if it is a cloud machine most services allow a virtual console from the web interface

    • @Ebbzzor
      @Ebbzzor 4 года назад

      @@SuperMuchonacho Right. But often times that's a rented virtual machine.

    • @nivlemspeaks
      @nivlemspeaks 4 года назад

      You could have a backup copy of you ssh key somewhere else that you could import onto another machine and use to login.

    • @maklor
      @maklor 4 года назад

      @@Ebbzzor a lot of providers have a login console/shell on the management website

  • @oijgg3p
    @oijgg3p 2 года назад

    Can someone explain tp me, when he created a vm, how did he got that password? Let's say, I instaled any linux distro as a vm, and I know it has openssh client.. where can I find a password for that system?

  • @someoneonyoutube181
    @someoneonyoutube181 4 года назад

    why is the brim of your hat so bent? it almost does a full 180

  • @leocarvalho8051
    @leocarvalho8051 4 года назад

    my authorized_keys already has content. Should i append the public key to it??

  • @Hartley94
    @Hartley94 4 года назад

    ❤❤❤

  • @speedibusrex
    @speedibusrex 4 года назад

    Use 2FA as an alternative.

  • @ParabulaMan
    @ParabulaMan 3 года назад

    can i buy you a cup of coffee?

  • @kr4k3nn
    @kr4k3nn 4 года назад

    sir,
    suppose,
    i have a private key of my friend, i can log into that machine using ssh from my machine and by using that private key?

    • @macethorns1168
      @macethorns1168 3 года назад +1

      If that server has the public key for that private key in the authorized_keys file, yes.

  • @lordraj365
    @lordraj365 3 года назад

    Difference between .ppk, .pem, .pub ?

  • @0xssff
    @0xssff 4 года назад

  • @Jeroen_a
    @Jeroen_a 4 года назад

    Thanks EM. i had already enabled public/private keys on my home servers but was a bit concerned about disabling the password logins (for reasons you have explained)..... i guess there is no reason to keep it on :)

    • @EngineerMan
      @EngineerMan  4 года назад

      The backup plan is always serial console access. Most cloud servers support this and if you have physical access it's supported as well.

  • @creativeclub2023
    @creativeclub2023 4 года назад +1

    Binod here ?

  • @creativeclub2023
    @creativeclub2023 4 года назад +1

    First View 🤣

  • @olafcreed4726
    @olafcreed4726 4 года назад

    You shouldn't be telling people this is more secure as it is not. Using this with a password would be much more secure and is advisable always. Use passwords people. Engineer Man is only doing this for a specific purpose of automation, which is not best practice.

    • @EngineerMan
      @EngineerMan  4 года назад

      I didn't say it was more secure, I simply said I need to automate things and thus I can't use a password. People are free to choose.

    • @norter_
      @norter_ 4 года назад

      How is private key less secure than a password?

    • @EngineerMan
      @EngineerMan  4 года назад

      After I wrote my comment I realized I wasn't sure if he meant the passwords on the keys themselves or passwords to the server.

  • @sagunasakariya5228
    @sagunasakariya5228 4 года назад +1

    huge fan. plaease give shoutout

  • @sagunasakariya5228
    @sagunasakariya5228 4 года назад +1

    i am first to comment
    :)