Configuring Passwordless Server Login Using SSH

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ธ.ค. 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!

  • @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.

  • @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!

  • @pr0d1g1
    @pr0d1g1 3 ปีที่แล้ว

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

  • @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.

  • @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.

  • @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... 🤦‍♂️🤣

  • @tech-daddy
    @tech-daddy 3 ปีที่แล้ว +1

    Great guide, simple and well explained.

  • @Codester145
    @Codester145 4 ปีที่แล้ว +1

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

  • @eputen
    @eputen 4 ปีที่แล้ว

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

  • @AlfieVLOG0
    @AlfieVLOG0 3 ปีที่แล้ว +1

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

  • @williamb.2031
    @williamb.2031 4 ปีที่แล้ว

    Awesome stuff as always! Thanks :)

  • @mansourq6512
    @mansourq6512 4 ปีที่แล้ว

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

  • @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. :)

  • @stalebread7972
    @stalebread7972 4 ปีที่แล้ว

    Great video, lots to learn

  • @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?

  • @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.

  • @someoneonyoutube181
    @someoneonyoutube181 4 ปีที่แล้ว

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

  • @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

  • @leocarvalho8051
    @leocarvalho8051 4 ปีที่แล้ว

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

  • @CamStansell
    @CamStansell 4 ปีที่แล้ว

    brilliant. thanks

  • @bordertone_5138
    @bordertone_5138 3 ปีที่แล้ว

    Thank you so much

  • @lordraj365
    @lordraj365 3 ปีที่แล้ว

    Difference between .ppk, .pem, .pub ?

  • @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.

  • @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.

  • @biniesh7097
    @biniesh7097 4 ปีที่แล้ว

    thanks for simplifiying

  • @jonasbergkvist6381
    @jonasbergkvist6381 4 ปีที่แล้ว

    Great vid, follow it up with key management please!

  • @Hartley94
    @Hartley94 4 ปีที่แล้ว

    ❤❤❤

  • @sunwire
    @sunwire 4 ปีที่แล้ว

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

  • @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.

  • @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.

  • @ParabulaMan
    @ParabulaMan 3 ปีที่แล้ว

    can i buy you a cup of coffee?

  • @speedibusrex
    @speedibusrex 4 ปีที่แล้ว

    Use 2FA as an alternative.

  • @0xssff
    @0xssff 4 ปีที่แล้ว

  • @creativeclub2023
    @creativeclub2023 4 ปีที่แล้ว +1

    Binod here ?

  • @sagunasakariya5228
    @sagunasakariya5228 4 ปีที่แล้ว +1

    huge fan. plaease give shoutout

  • @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

    i am first to comment
    :)