How to SSH Without a Password (like a boss)

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ม.ค. 2025

ความคิดเห็น • 102

  • @vaishnav3735
    @vaishnav3735 3 ปีที่แล้ว +7

    Congratulations on 7k

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

      Thank you so much 😀

    • @PragMero
      @PragMero 2 หลายเดือนก่อน

      Congratulations on 110k

  • @imad54321
    @imad54321 2 ปีที่แล้ว +1

    simplifies and to the point. well put together and delivered. Nice.

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

    Nice video. Instead of using the host a and host b text files, to distinguish between the two machines, you can run the hostname commands on each machine. Thanks for the great video!

  • @MichaelSharpTechniSmart
    @MichaelSharpTechniSmart 2 ปีที่แล้ว +5

    Tony, why didn't you need to edit the sshd_config file to uncomment and change lines to no?
    It still keeps prompting me for a password.

  • @biswadipdasgupta4204
    @biswadipdasgupta4204 2 ปีที่แล้ว +1

    Crystal-clear explanation! 👏👏

  • @deangilbrough7339
    @deangilbrough7339 ปีที่แล้ว

    Exactly what I was looking for! Thanks!

  • @fabiogarcia1431
    @fabiogarcia1431 2 ปีที่แล้ว

    Your instructions are very clear. Thanks, dude. God bless you.

  • @RIP123
    @RIP123 3 หลายเดือนก่อน

    Nice! only had to watch 1 video to understand SSH keys :)

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

    Nice video and informative. I am trying to to an rsync from my VM server over to my NAS. With root, I do not get prompted for a password. with any other user, I get prompted to enter a password. I tried the same for just doing ssh. Even if I have multiple keys in the authorized_keys file. What am I missing, thanks.

  • @israiqbal1414
    @israiqbal1414 2 ปีที่แล้ว +2

    Hi there! At 2:09 you "pasted your password in and entered" but what if we do not know the password? What should we do instead?

    • @israiqbal1414
      @israiqbal1414 2 ปีที่แล้ว

      also at 4:25 you "copied the password" but from where? I am sorry I am a beginner :"))

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

      @@israiqbal1414 I'm sure you've figured this out by now but I'm leaving this answer if anyone else get stuck on this. In the video he already knew the password and by your question it looked like you didn't know the password for your server. Well in this case one can use private key with the following command "
      ssh -i your-private-key user@ip "

  • @Seansaighdeoir
    @Seansaighdeoir 2 ปีที่แล้ว

    Very helpful video, many thanks!

  • @iambernardyanzon
    @iambernardyanzon 3 ปีที่แล้ว +4

    Hi Tony, thanks for the amazing tutorial. It really helps especially for me as a beginner. I have a quick question about the password. What if you don't have the server password and I only have a private key. Can you use the private key to log in instead of the password directly? My user name and IP connect me to the server but it was asking for the password. When I tried to paste the private key it won't allow me it says invalid. Is it possible to use a private key instead without login in using your password?

    • @TonyTeachesTech
      @TonyTeachesTech  3 ปีที่แล้ว +4

      If that's the case, you can access the server like this:
      ssh -i your-private-key user@ip

  • @alhonaifi
    @alhonaifi 2 ปีที่แล้ว

    Thank you, great presentation (techniques and info)

  • @MukeshKumar-vv3wd
    @MukeshKumar-vv3wd ปีที่แล้ว

    good presentation, to the point and simple enough

  • @moustaphasd
    @moustaphasd 2 ปีที่แล้ว

    How can I do that with a server local windows and virtual server Ubuntu on VMware workstation ?

  • @S2eedGH
    @S2eedGH 2 ปีที่แล้ว +2

    what about password-less connection from linux to windows

  • @chilioil7686
    @chilioil7686 ปีที่แล้ว

    at 4:25 , what exactly did you copy and entered exactly?

  • @nikolcenalevski5164
    @nikolcenalevski5164 2 ปีที่แล้ว

    this is so helpful , thank you for sharing!!!

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

    Thank you! If we are connecting to different servers do we generate different public keys for each server or the same one is used over and over?

    • @TonyTeachesTech
      @TonyTeachesTech  3 ปีที่แล้ว +2

      You can use the same public key for multiple servers

  • @chenyao1144
    @chenyao1144 6 หลายเดือนก่อน

    Thanks! It really helps!

  • @Rambhaoa
    @Rambhaoa 5 หลายเดือนก่อน

    ServerA (ubuntu 12) and ServerB (Ubuntu 22)
    I had already done same process but still not able to takes 'password less' ssh access from ServerA of Server B. After reading lot of tutorials I read /var/log/auth.log on serverB where I was getting error "userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedAlgorithms [preauth]"
    Solution: I have entered parameter "PubkeyAcceptedAlgorithms +ssh-rsa" in ServerB's /etc/ssh/sshd_config file. Its working fine now.

  • @israelgatterer6821
    @israelgatterer6821 2 ปีที่แล้ว

    Hi Tony, in case of doing a script in geany how would you write a script that allows an individual person to communicate via ssh (sshpass) and execute nmap scans and geoip/whois queries?

  • @umakha
    @umakha ปีที่แล้ว

    Hola Tony. I do deeply appreciate your clear explanation about this important topic, but could you please let me know how we can connect to the remote server while the firewall in on, and we are not allowed to use port 22?

    • @Lydia13778
      @Lydia13778 ปีที่แล้ว

      you can change what port ssh used. if you are trying to run ssh without opening a port, any incoming data requires an open port however, this is true every application that accesses the internet.

  • @thenewone3944
    @thenewone3944 2 ปีที่แล้ว

    Really hope this reaches you, but will it still prompt for a password every time its changed? If the password use isn't disabled and expires and changes will they still have to receive it and enter it again?

  • @lands1459
    @lands1459 4 หลายเดือนก่อน

    what does your ssh config look like? i'm still getting asked for a password even though i have a key. password does not work.

  • @TeleCamaguey
    @TeleCamaguey 4 หลายเดือนก่อน

    does the public key need to be the same for the client and server machine to allow passwordless connection?

    • @TechTute
      @TechTute 4 หลายเดือนก่อน

      You only need to place the client's public key on the server to enable passwordless SSH authentication.

  • @photogyulai
    @photogyulai ปีที่แล้ว

    Suggestion if the server still let you in with password after the above settings.
    In my sshd_config file there is a line `Include /etc/ssh/sshd_config.d/\*.conf`
    And inside this folder there were another .conf file with one line: `PasswordAuthentication yes`
    So, I had to modify the other configuration file as well.

  • @SHARK224
    @SHARK224 2 ปีที่แล้ว

    May I know I share the pub key to another host to logon the server with no password for another users?

  • @stevepaterson7740
    @stevepaterson7740 29 วันที่ผ่านมา

    I tried establishing the password less connection several times but the system keeps rejecting it, saying "permission denied". What should be wrong with my connection?

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

    Thanks Tony!

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

    Thank you. (Read until the end)
    I have 2 old computers in my house + 1 raspberry pi + 1 main computer.
    I use sshfs to create a network between them so I can have some sort of "mesh NAS", but it was very tedious to put the 12 keys each time I tuned on any device.
    One little problem. Any pc can now connect to any other PC without password, except for PC N°4. I need to input a password for (PC1) -> (PC4), (PC2) -> (PC4) and (PC3) -> (PC4).
    Any idea why?

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

      Sorry Luis, I don't know why. I would need time on your network to determine

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

    very useful !! thanks !!

  • @maxvanheuveln2829
    @maxvanheuveln2829 2 ปีที่แล้ว

    I am getting a mkdir cannot create .ssh directory already exist error?

  • @danielajoycortez7591
    @danielajoycortez7591 10 หลายเดือนก่อน

    Hi, I just wanna ask how did you know your root@ip's password?

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

    On password what did you paste, I didn't get this part actually.

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

      Assuming you already have ssh access to a server, that's your user password

  • @programming2347
    @programming2347 ปีที่แล้ว

    I need to do that but from a windows machine to an ubuntu machine, its been hours and I jus cannot solve it.

  • @Nick-gj9gz
    @Nick-gj9gz 2 ปีที่แล้ว

    Hi Tony, I tried this from a Mac to PC, but after I input the password (as 4:23 in this video), I got some error codes, and I still need password to ssh. Is there anything I missed?

    • @Nick-gj9gz
      @Nick-gj9gz 2 ปีที่แล้ว

      could it be the path problem?

  • @VANTYCSolutions
    @VANTYCSolutions 2 ปีที่แล้ว

    Thank you my friend!

  • @rustinpevehouse2831
    @rustinpevehouse2831 2 ปีที่แล้ว

    Any tips on setting up passwordless SSH into a raspberry pi from windows (Visual Studio Code specifically)

    • @TonyTeachesTech
      @TonyTeachesTech  2 ปีที่แล้ว +1

      If using Win 10 or above, the same steps should apply. Or are you using putty?

    • @rustinpevehouse2831
      @rustinpevehouse2831 2 ปีที่แล้ว

      @@TonyTeachesTech I was using VSC on windows to connect to my pi but was having trouble with generating SSH keys. Ultimately I realized the keys were not being put into the .ssh folder, and after I moved them I was able to follow your steps with ease!

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

    thank you Tony!

  • @Uppercas3
    @Uppercas3 ปีที่แล้ว

    When copying the pub key, you entered a password. Where did you get it assuming you don't know it for the remote server

    • @Herzfeld10
      @Herzfeld10 4 หลายเดือนก่อน

      If you don't know the remote server password then maybe you shouldn't have access to it...

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

    password is needed in all cases

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

    Hey I was not able to find the ssh file. Am I supposed to download OpenSSH or does it only show once I have SSH'd to a destination. A bit confused and I'm sort of a noob

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

      Perhaps if ssh isn’t installed, then you might need to install it but this typically comes preinstalled on most systems

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

    this doesn't work, i'm trying it from a macbook (not a ubuntu or freebsd machine) using term
    can you try it and see if you can get it to work from a mac laptop as the host
    I think it requires editing the SSHD conf file on the mac - please try and see if you can get it working without using ubuntu - there probably will be different steps needed...

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

      The sshd config file is only relevant on the server that you are sshing into. The "d" in sshd is for daemon and is referring to the background process that waits for incomming ssh connections.
      When you say that it doesn't work, what error message do you get?

  • @timborg770
    @timborg770 ปีที่แล้ว

    Missleading title. You actually DO SSH to a server with password. Not possible to transfer your key to the server without having to first establish a password connection?

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

      Yes I suppose you're right since you initially need the password for setup

  • @vishaalkumaranandan2894
    @vishaalkumaranandan2894 2 ปีที่แล้ว

    I just got the host key, no username,no password,What should I do now

  • @mohamedabdullah4223
    @mohamedabdullah4223 2 ปีที่แล้ว +1

    its still asking for my root password

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

    short and easy to follow thx

  • @rahulnagpal99
    @rahulnagpal99 2 ปีที่แล้ว

    I have do the same thing many times but it is still asking me for the password...

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

    top of the tops

  • @walderrangx
    @walderrangx 7 หลายเดือนก่อน

    How can you share this key if you don't have a password, or if you do have a password there is no reason to do so

    • @Herzfeld10
      @Herzfeld10 4 หลายเดือนก่อน

      If you don't have the password then you don't own the user of the remote machine. Of course you can't access it it would be a huge security flaw.
      And this isn't useless at all if you need to automatize file transfert with scripts.

  • @i3looi2
    @i3looi2 5 หลายเดือนก่อน

    I AM MAD. Nothing of this works.. on a fresh ubuntu22 VPS install.
    All 20 tutorials say /show the same thing. Nothing works.

  • @user-bx6vg7fo8e
    @user-bx6vg7fo8e 2 ปีที่แล้ว

    great man, thanks

  • @afshaarahmed2114
    @afshaarahmed2114 ปีที่แล้ว

    error publickey denied
    1: public ip(given)
    2: azure virtual machine
    any suggestion?

  • @Ignalvarez
    @Ignalvarez 11 หลายเดือนก่อน

    great content

  • @hajji384
    @hajji384 2 ปีที่แล้ว

    Still asks me a password

  • @chuashanjing2261
    @chuashanjing2261 ปีที่แล้ว

    to copy the pub key to another server u still need the password...

  • @georgichalakov6727
    @georgichalakov6727 2 ปีที่แล้ว

    Thank you!

  • @marcelltoth9737
    @marcelltoth9737 7 หลายเดือนก่อน

    Thanks a lot

  • @moeinmollaee
    @moeinmollaee ปีที่แล้ว

    thanks man

  • @bhavyanshagarwal9294
    @bhavyanshagarwal9294 3 หลายเดือนก่อน

    thank you

  • @suhas7585
    @suhas7585 2 ปีที่แล้ว

    thanks bro

  • @TYLONsRoar
    @TYLONsRoar 8 หลายเดือนก่อน

    👁👁
    I sore you enter a password

  • @degstenk
    @degstenk 11 หลายเดือนก่อน

    super!

  • @melanovapedia7924
    @melanovapedia7924 2 ปีที่แล้ว

    Thanks, you save my life and time jiahahah 🙏

  • @keypo790
    @keypo790 2 ปีที่แล้ว

    HEll yeah

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

    Aajj

  • @ٴٴٴٴۥۥٴٴٴٴۥۥٴٴٴٴۥۥٴٴٴٴۥۥٴٴٴٴٴٴ

    This is only for people who are too lazy to type the password right?

    • @TonyTeachesTech
      @TonyTeachesTech  2 ปีที่แล้ว +1

      It's a more secure way to connect via SSH

  • @submarine.7seas
    @submarine.7seas ปีที่แล้ว

    Thank You!