How to Enable SSH on a Raspberry Pi (and connect via IP)

Поделиться
HTML-код
  • Опубликовано: 24 дек 2020
  • Learn how to SSH into a headless Raspberry Pi by setting up WiFi, enabling SSH access, and determining the IP address.
    Get a Raspberry Pi 4 on Amazon 👉 amzn.to/2Ka0swl
    Code snippets and more at tonyteaches.tech/raspberry-pi...
    Check out my vlog channel ‪@TonyFlorida‬
    #raspberrypi #ssh
  • ХоббиХобби

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

  • @csenior10
    @csenior10 2 года назад +4

    Thank you. Your ssh directions were the only ones that worked for me. You rock and I subscribed for that.

  • @nimbleCo
    @nimbleCo Год назад +22

    If you got a "denied" error when logging in like I did, this was helpful: Recently, the default user setup of Raspbian was significantly changed, rendering most existing online tutorials invalid.
    In essence, the default pi user no longer exists, so you have to create it and set its password using either the official Imager tool or by creating a userconf file in the boot partition of your microSD card, which should contain a single line of text: username:hashed-password, replacing username with the name of the user you want (e.g., pi) and hashed-password with the hash of the password you want.

    • @Indi_DevJames
      @Indi_DevJames Год назад +1

      thanks man ive litterally been so confused for the last four days lmao

    • @osm4834
      @osm4834 Год назад +3

      @@Indi_DevJames even after doing that it still keeps saying wrong password (i set the user and pass to raspberry)

    • @szabyperjesi3421
      @szabyperjesi3421 Год назад

      thank you so much, I've been searching for this answer for too long! :D

    • @user-uf7bx2bi9z
      @user-uf7bx2bi9z 10 месяцев назад

      ever figure it out?@@osm4834

    • @SunsetSwells
      @SunsetSwells 2 месяца назад

      Same, mine still says invalid. Been searching for the answer for days and tried multiple solutions with no luck.

  • @michaelsullivan-kp6od
    @michaelsullivan-kp6od 5 месяцев назад +1

    Thanks for emphasising the OS for headless setup. Wished I’d viewed your presentation a week ago.

  • @reloadfast
    @reloadfast 3 года назад +43

    Calm, relaxed voice, excellent, in detail explanation... man, you are going places. Awesome content. Thank you for taking the time to create it.

  • @edwinbarreto58
    @edwinbarreto58 Год назад +2

    Very informative and easily explained! Thank you

  • @sachavez100
    @sachavez100 2 года назад +1

    This tutorial was very helpful. Thanks a ton.

  • @tgln
    @tgln Год назад

    Thank you very much for the videos on this subject you have been a lifesaver.

  • @chandankumar.u4548
    @chandankumar.u4548 3 месяца назад +2

    Pro tip: For whatever reasons if none of the methods are working for you. Just find a monitor for 1 time use (maybe from someone who has monitor or from computer lab). connect to monitor via hdmi. Then connect to your wifi inside raspberry os ... boom you've done what is required. From next time you can access it remotely via vnc. just set up ssh before vnc. also your laptop should be connected on same network.

  • @sachavez100
    @sachavez100 11 месяцев назад +6

    This was a great tutorial. I followed all instructions an even linked to your website. However, I getting this error: Permission denied (publickey,password). I even reset my pw to something very simple so I wouldn't mistype. I can ping the Raspberry Pi, but cannot log in via SSH. Any ideas?

  • @NewbTasticliveshere
    @NewbTasticliveshere Месяц назад

    Thank you so much for this clear and concise tutorial.
    Really helped me out today and I understood the procedure perfectly.

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

    10/10 video help me set up my raspberry pi that I was having trouble with. New sub too

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

    This is perfect ! Thank you

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

    This was perfect! Worked fantastic

  • @Jpquant
    @Jpquant Год назад

    Great video. Thank you

  • @abbagang3844
    @abbagang3844 2 года назад +6

    great tutorial, just here to mention that the official imager now has support to enable these without having to create these files

    • @abrahamalam6111
      @abrahamalam6111 2 года назад +1

      to add to this: hit Ctrl-Shift-S in raspberry pi imager (or hit the settings "gear" icon) to open a 'secret' menu. From there, you can enable ssh and join wifi without creating the files in this video.... but the ending is still helpful, to rename the hosts! Thanks for an awesome video Tony

    • @DanJohnson05
      @DanJohnson05 Год назад +2

      I used the new image and enabled SSH and entered my WiFi credentials but I am still unable to access my pi.

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

    terrific video - content and delivery, thanks Tony. Question: i shutdown the pi via ssh, how do i start it back up again? No keyboard, mouse, screen attached to the pi. really appreciate your help. thanks

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

      If you shutdown via ssh, you will need to unplug the power cord and plug it back in

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

    hands on the best tutorial.
    the only missing part is how should I edit the with vim command ? I kept pressing all buttons till eventually it started editing. and how do you save ? ... the proper way

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

      Lol whoops I always forget to explain this. Here's a quick video to explain ruclips.net/video/uE4aljoMBeg/видео.html

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

    Great tutorial, thank you!

  • @MoTopiwala
    @MoTopiwala Год назад

    Quality Content! Succinct oration with a reassuring affect :D

  • @imrem9673
    @imrem9673 Год назад

    in th new imager (10.2022) you can use the advanced options (small gear wheel bottom right) to set up WiFi - for SSH not sure if it's working

  • @drew7272
    @drew7272 6 месяцев назад

    Thank you so much!

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

    Very detailed explanation video
    I appreciate you for not using background music and as a beginner i learned a lot from this video.
    Care to explain what ssh-keygen -R 192.168........... command does?

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

      Thanks. That will generate an ssh key for you

  • @voltmanip
    @voltmanip 2 месяца назад

    this guy is only one that could explain this correctly thanks so much

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

    Thank you so so so muchh , very helpful

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

    Got it! Love this channel

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

    Thanks alot ..its working

  • @trikztr
    @trikztr 2 месяца назад

    thank you so much!

  • @michaelinzo
    @michaelinzo Год назад +1

    I can ssh in my raspberry pi yesterday but I have pihole working is this interfering?

  • @pshermanart
    @pshermanart 2 года назад +1

    I tried copying the files using Windows explorer, and it looked like they copied, but when I refreshed they weren't there. Note that when I installed the image, it partitioned the SD card into two drives. Is that right?

  • @MrGhost9640
    @MrGhost9640 Год назад

    By fate u just helped me ssh-keygen command priceless

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

    Thank you !

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

    I like how he teaches

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

    RPi and Laptop is in same n/w still it shows error ssh: connect to host port 22: No route to host. Then I tried to ping that ip which gave o/p Destination Host Unreachable. I've confirmed it is in the same network using airodump-ng but in nmap scan, it didn't show up. Is there any fix?

  • @andysPARK
    @andysPARK Год назад

    So, how do you establish SSH keys between host PC and the pi?
    I've followed guides, but haven't got it to work yet. Can only login using SSH passwords.

  • @1world1family
    @1world1family 3 года назад +2

    Great tutorial, thanks Tony. How to change user name and password of raspberry pi?

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

      This should tell you exactly what you need to know ruclips.net/video/COp6JtP45o8/видео.html

  • @ethanboba5262
    @ethanboba5262 3 месяца назад

    great tutorial

  • @eamonhannon1103
    @eamonhannon1103 4 месяца назад

    Does the procedure to discover the IP address work if you have direct connection from the Raspberry Pi using an Ethernet cable to the Ethernet port on the PC ?

  • @dark_phoenix_9537
    @dark_phoenix_9537 Год назад

    What must I do in the advanced settitng (Imager ctrl+shift+x) because it doesn't work

  • @chubbyzombie666
    @chubbyzombie666 Год назад +13

    $50 in 2020. In 2022 it's $140.

  • @marcoswwong1
    @marcoswwong1 8 месяцев назад

    what can we do with the ssh? can we open a browser at ssh? can demo?

  • @rudrarajput1791
    @rudrarajput1791 3 года назад +2

    thanks

  • @hugorebelo7851
    @hugorebelo7851 Год назад

    How does the raspbery conects to the internet before you make the login?

  • @Caller8194
    @Caller8194 7 месяцев назад +1

    I have the correct IP address and ran the ssh pi@IPADDRESS command. I tried 'raspberry' as the password but i keep getting permission denied. I have not used this raspberry pi, and have only done the things that this video said to do. Help please

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

    you are awesome

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

    Hi when i am trying to enter the pass- for the pi like raspberry its denied can you help for the same

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

    thank you so much! but what is the difference if i connect with ethernet cable? can you explain?

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

      You will not need to configure WiFi if connecting with ethernet. You will automatically connect this way

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

    Great video Tony, very helpful. I have an issue accessing SSH, I had to make a fresh install of pi os and after that I am getting Access denied when trying to enter the password. I tried deleting the old key in known_hosts but that didn't help. The password is correct and SSH is enabled from raspi_config. any idea about this issue? thanks

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

      Are you using the right user?

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

      @@TonyTeachesTech yes, which is still Pi

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

      @@mokhreizat5145 which is lowercase pi, right?

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

      @@TonyTeachesTech yup, the third try it says: Permission denied (publickey, password), although the password is correct. I can access the comand when i plug the pi to a monitor and a keyoard.

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

      @@mokhreizat5145 perhaps your public/private key has changed or been moved? Are you in a position to reimage the Pi and start over? That's probably easiest rather than debugging. Were you ever able to login via ssh?

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

    Now this is a super useful video. My Raspberry Pi 4 is 2gb of ram, not 4 or 8. Is that a problem?

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

    any solution to the default password not working? Bought a new kit from canakit and raspberry password is not working for me.

  • @buttondeity3933
    @buttondeity3933 5 месяцев назад

    how do do in windows

  • @Sensance
    @Sensance 2 года назад +4

    executed as described with a fresh installation but it shows me: permission denied
    with pi@IPadress and pw: raspberry

    • @pransukh8250
      @pransukh8250 Год назад

      i have the same issue.

    • @Sensance
      @Sensance Год назад

      @@pransukh8250 the solution was it doesnt worked via ssh initial. So i connected the Pi to my Monitor and my keyboard and run the configuration locally. After the first setup i hang the pi into the wireless and it worked even with ssh for me

    • @pransukh8250
      @pransukh8250 Год назад

      @@Sensance Thanks for reply, what i did to resolve my issue, i just created userconf file and put USERNAME:HASHED_PASSWORD and saved it and then logged in with same credentials what i have defined in userfconf file and it worked. according to raspberry official guide lines user pi is not defined in new installation we need to do it on our own.

  • @MooseGoWoof
    @MooseGoWoof Месяц назад

    How do I do this one Windows?

  • @pernicekcz3900
    @pernicekcz3900 5 месяцев назад

    help i cant find it on my network i have raspberry pi zero W

  • @AhmedKhaled-yc6tf
    @AhmedKhaled-yc6tf 7 месяцев назад

    Hello ,, i want to ask a Question ,,, what to do if my Pi is Locked with password,, so each time i power it with the File its not connected to my network

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

    what sort of file would you use to create the ssh file if your on windows?

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

    why do you use pi@IP_ADDRESS to establish a connection? does "pi" represent the user we are using to log in?

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

      Yes that's the default username

  • @battulgatsogtbaatar1216
    @battulgatsogtbaatar1216 6 месяцев назад

    hi
    when i write ssh pi@ and ip address mac termnial returns operation timed out how can i solve it help me guys

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

    What if the IP address changes...Can you do a demo on how to keep the same connection whether or not the IP has expired

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

      You can assign a static IP for the pi via your router control panel

  • @uksuperrascal
    @uksuperrascal 2 года назад +1

    My Wifi is to slow for my Pi Zero 2 W - I need to use the USB to Cat45 to get faster Internet Have you made a video ? I am using Ubuntu Studio 18.04 to set up the Pi OS. I can not get Imager to install via the install manager Can You Help ?

  • @rushabh.r6109
    @rushabh.r6109 Год назад

    You need to create a new vid for the updated software for Raspberry PI

  • @tdsgamer8048
    @tdsgamer8048 2 года назад +1

    After typing the password it says permission denied please try again
    What to do

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

    When I add my WiFi and Password, and try save with the :WP I get a file that says wpa_supp.swp.... not.conf? It wont let me delete or type over the --INSERT--

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

      It should be... Esc :wq ruclips.net/video/uE4aljoMBeg/видео.html

  • @sammypokego7536
    @sammypokego7536 Год назад

    how do i type in the password it is not working for me

  • @jambodjembe
    @jambodjembe 2 года назад +1

    So I was doing well for the first 4 minutes and then along came a Terminal Window? I have no clue what that is.

    • @TonyTeachesTech
      @TonyTeachesTech  2 года назад +1

      If you're using Windows you'll want to use Putty ruclips.net/video/pWDHUlvcAsg/видео.html
      And if you're on Mac use Terminal ruclips.net/video/SfTSBbaFN8Y/видео.html
      For creating the file around the 4 minute mark, you can also just use the file explorer to do that

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

    I enabled SSH. And configured the .CONF but when I try to ping it just says unknown host

    • @TonyTeachesTech
      @TonyTeachesTech  2 года назад +1

      See if you have luck with the command "arp -a" to scan all IPs on your network

  • @HenleyLive
    @HenleyLive 2 года назад +2

    wheres windows version

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

    help, i try ssh pi@(IP) and ssh pi@raspberry but it doesn't work... it shows that error: ssh: connect to host (IP) port 22: Connection refused

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

      I’m not sure why that would happen if you followed the steps in this video. Did you try pi@raspberry.local

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

    ping raspberrypi.local doesn't work for me. It returns "Destination net unreachable". Thus, to find the IP address of the Pi, I have to use a monitor and run ifconfig on the Pi, but that defeats the purpose of running headless. Is there another way to discover the IP address of the Pi? Sure, I know it now, but it might change if the router or Pi get reset, then I'll have to discover the new IP.

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

      The arp -a command will show all ip addresses on your network

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

      @@TonyTeachesTech Wow, I'm glad to know of this command, thanks. However, still, the RPi isn't listed there and I can still SSH into it.
      Luckily, it looks like the IP doesn't reset on reboot, but that still leaves the router rebooting.

  • @mahmutozcan8759
    @mahmutozcan8759 3 дня назад

    What do i have to do if the default paswoord doesnt work

  • @Orange-Oreo113
    @Orange-Oreo113 10 месяцев назад

    Where is the cheat sheet

  • @danharris4528
    @danharris4528 5 месяцев назад

    Does not work with Raspberry Pi5 on Windows 11.

  • @𝘿𝙖𝙧𝙩𝙝𝙑𝙖𝙙𝙚𝙧3DS

    Im having a problem, it wont connect to wifi. I have a rasbpi 3, and I followed all the steps perfectly and even tried reflashing the os. nothing helps. what am I doing wrong? edit: I think the ssh and wpa files are getting deleted from the boot directory, pls help lol

    • @Ponduck
      @Ponduck 11 месяцев назад

      i have the same problem

    • @𝘿𝙖𝙧𝙩𝙝𝙑𝙖𝙙𝙚𝙧3DS
      @𝘿𝙖𝙧𝙩𝙝𝙑𝙖𝙙𝙚𝙧3DS 11 месяцев назад

      @@Ponduck turns out that I was just out of range, if I remember correctly. just put it next to the router, see if it helps. Also if your router is on a 5G band its more likely to be out of range

  • @Error_404_Account_Deleted
    @Error_404_Account_Deleted Месяц назад

    Sold me at Old Bay

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

    I’m getting an “Unknown Host” message every time I try to ping the pi?????

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

      Maybe try to execute "arp -a" to do a device scan on your network or check your router's device list if you have access to it

  • @totaltrinkets
    @totaltrinkets 2 года назад +1

    how to ssh into rasberry pie that has the desktop view.

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

    Help, I try pinging my Pi and it tells me, "ping: cannot resolve raspberrypi.local: unknown host"

    • @justjoejoe_0
      @justjoejoe_0 2 года назад +1

      50min later. Figured it out... somehow. For anyone else who might struggle with this. I just formatted and reinstalled the os until it worked. Ik it's vague, but I don't understand it either. Don't give up!!

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

      Glad you figured it out

    • @dark_phoenix_9537
      @dark_phoenix_9537 Год назад

      I formattet and re-installed it million times but it doesn't work. :(

  • @wx10
    @wx10 Год назад

    09:03 raspberry log in error "Nasty" solved #kalNotes

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

    Bro I get "access denied" after typing password. Can you help ?

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

      Make sure you are providing the correct username and password and that user has SSH access

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

      this issue has been resolved still or not ?

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

      Resolved 👍

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

      Now I am getting Non Fat Partition Error after I reboot raspberry pi everytime.

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

      @@alisherkhan6107 I am also getting same error when i am trying to enter password on ssh password access denied showing. Can you explain that how have you resolved it

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

    My rpi4 was 149$ .....

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

      $149 US dollars? 😱

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

      did u buy the kit? thats prob why

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

      Even if that was a whole kit, you overpaid.

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

      @@trajectoryunown it could be with a ssd or a high storage micro mine was a kit that was $120 with a 32 gig microsd

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

      I paid about the same price for mine with a 32gb so card, dunno what made me think it already had games on it

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

    Ping raspberry pi dose not work😰

  • @SteeyRebel
    @SteeyRebel 10 месяцев назад

    You didn't even link the shit down in the description...

  • @Jah_Rastafari_ORIG
    @Jah_Rastafari_ORIG 2 месяца назад

    FFS. ON AN EXISTING INSTALL!

  • @dw6528
    @dw6528 10 месяцев назад

    Critical Note:
    The command ssh-keygen -f - is not a command which effects anything within the Rapsberry Pi
    (the system into which one wants to ssh)
    Its affect is within the Client system.
    In some cases this command will require higher permissions (aka operation denied)
    In such case add sudo to the command.

  • @sergeungureanu8831
    @sergeungureanu8831 Год назад

    pidazaz ibanii

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

    What a waste of time this was. Doesn’t work!
    (initially seemed like a complete waste of time but after much diligence the pointers were a helpful reference)

    • @TonyTeachesTech
      @TonyTeachesTech  3 года назад +2

      Sure it works! What problem did you run into?

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

      @@TonyTeachesTech
      8 hours later:
      ...
      Warning: Permanently added '192.168.1.2' (ECDSA) to the list of known hosts.
      ssh_dispatch_run_fatal: Connection to 192.168.1.2 port 22: Broken pipe
      (base) MacBook-Pro:~ iXXXXXX$ ping raspberry.local
      ping: cannot resolve raspberry.local: Unknown host
      (base) MacBook-Pro:~ iXXXXXX$

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

      @@TonyTeachesTech I somehow got it working with some tinkering for hours. Thanks for the initial pointers. I did have to watch 3 other videos & combine that info to make sense of what you're doing though tbh just not as comprehensive as i needed

    • @TonyTeachesTech
      @TonyTeachesTech  3 года назад +3

      @@fluxpistol3608 Sorry my video wasn't as helpful as I intended it to be. I'm happy to hear that you got it working

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

      you noob you dont know anything

  • @danielliden6829
    @danielliden6829 Год назад +3

    WARNING! THIS VIDEO IS OUTDATED BUT CAN STILL BE USED!
    All you have to do is add a little thing. You will add the SSH file and the wpa_supplicant.conf file just as described in the video.
    But after an update, it is now necessary to create a userconf.txt (just a normal textfile) and in the textfile enter this:
    "pi:$6$/4.VdYgDm7RJ0qM1$FwXCeQgDKkqrOU3RIRuDSKpauAbBvP11msq9X58c8Que2l1Dwq3vdJMgiZlQSbEXGaY5esVHGBNbCxKLVNqZW1"
    (be sure to not copy the quotes "")
    After that, save the userconf.txt and then also put it in the boot directory (same as you put ssh and supplicant. Now you can continue to follow the video tutorial and everything will work out great!)
    (IF YOU DON'T DO THIS, THEN YOU WILL GET PERMISSION DENIED WHEN YOU TRY TO ENTER "raspberry" AS THE PASSWORD!)

    • @PauloIrineudeSouza
      @PauloIrineudeSouza 10 месяцев назад

      I am a complete noob, and i just wanna use raspberry pi for klipper on mu 3d printer. So, how can i creat ssh file on Windows 10?
      Can you help me, please?

    • @PauloIrineudeSouza
      @PauloIrineudeSouza 10 месяцев назад

      Another doubt is about your .txt file, i change the username and password, so i wanna edit your recommendetion text file?

    • @krs7936
      @krs7936 6 месяцев назад

      It's working