{"id":370931,"date":"2021-11-22T23:00:59","date_gmt":"2021-11-22T20:00:59","guid":{"rendered":"https:\/\/en.buradabiliyorum.com\/how-to-ssh-into-your-raspberry-pi\/"},"modified":"2021-11-22T23:00:59","modified_gmt":"2021-11-22T20:00:59","slug":"how-to-ssh-into-your-raspberry-pi","status":"publish","type":"post","link":"https:\/\/buradabiliyorum.com\/en\/how-to-ssh-into-your-raspberry-pi\/","title":{"rendered":"#How to SSH Into Your Raspberry Pi"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a3e3a6dcf2e8\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #dd3333;color:#dd3333\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #dd3333;color:#dd3333\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a3e3a6dcf2e8\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-ssh-into-your-raspberry-pi\/#What_Is_SSH\" >What Is SSH?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-ssh-into-your-raspberry-pi\/#Before_You_Turn_On_SSH_Mind_Your_Security\" >Before You Turn On SSH, Mind Your Security<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-ssh-into-your-raspberry-pi\/#Discover_the_IP_Address_or_Hostname_for_Your_Raspberry_Pi\" >Discover the IP Address or Hostname for Your Raspberry Pi<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-ssh-into-your-raspberry-pi\/#Option_1_Enable_SSH_Through_the_Desktop\" >Option 1: Enable SSH Through the Desktop<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-ssh-into-your-raspberry-pi\/#Option_2_Enable_SSH_From_the_Terminal\" >Option 2: Enable SSH From the Terminal<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-ssh-into-your-raspberry-pi\/#Disable_SSH_Root_Login\" >Disable SSH Root Login<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-ssh-into-your-raspberry-pi\/#Log_Into_Your_Raspberry_Pi_From_Another_Computer\" >Log Into Your Raspberry Pi From Another Computer<\/a><\/li><\/ul><\/nav><\/div>\n<p><strong>&#8220;#How to SSH Into Your Raspberry Pi&#8221;<\/strong><\/p>\n<div>\n<figure style=\"width: 1200px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"type:primaryImage wp-image-768061 size-full\" srcset=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2021\/11\/Raspberry-Pi-SSH-1.jpg?width=398&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1 400w, https:\/\/www.howtogeek.com\/wp-content\/uploads\/2021\/11\/Raspberry-Pi-SSH-1.jpg?width=1198&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1 1200w\" sizes=\"auto, 400w, 1200w\" src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2021\/11\/Raspberry-Pi-SSH-1.jpg?width=1198&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"A Raspberry Pi computer in housing\" width=\"1200\" height=\"675\" data-crediturl=\"https:\/\/www.shutterstock.com\/image-photo\/rasberry-pi-3b-computer-black-background-1639707223\" data-credittext=\"MAB32\/Shutterstock.com\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><figcaption class=\"wp-caption-text\"><span class=\"type:primaryImage imagecredit\"><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.shutterstock.com\/image-photo\/rasberry-pi-3b-computer-black-background-1639707223\">MAB32\/Shutterstock.com<\/a><\/span><\/figcaption><\/figure>\n<p>After\u00a0setting up your Raspberry Pi, you may not need a display for it. When it comes time for maintenance tasks, like upgrades and reboots, you can use Secure Shell (SSH) instead of plugging in a monitor. We\u2019ll show you how.<\/p>\n<h2 id=\"What Is SSH?\"><span class=\"ez-toc-section\" id=\"What_Is_SSH\"><\/span>What Is SSH?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>SSH, often typed all in lower case, stands for Secure Shell. It allows you to remotely connect to a server or system from another device using encrypted communications.<\/p>\n<p>The primary benefit of SSH is the encryption itself. With less secure remote login protocols, such as FTP, everything is sent in plain text. A hacker can sniff out those communications and log things like usernames and passwords. Since SSH is encrypted, that\u2019s no longer possible.<\/p>\n<p><strong>RELATED:<\/strong> <strong><em>What Is Encryption, and How Does It Work?<\/em><\/strong><\/p>\n<h2 id=\"Before You Turn On SSH, Mind Your Security\"><span class=\"ez-toc-section\" id=\"Before_You_Turn_On_SSH_Mind_Your_Security\"><\/span>Before You Turn On SSH, Mind Your Security<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Turning on SSH is easy, but let\u2019s not get ahead of ourselves. First, you\u2019ll want to make sure your Raspberry Pi is secure. That starts with the password for your user account.<\/p>\n<p>When you first set up your Raspberry Pi, you should have been prompted to change your user account password. If you did not, you need to do so now. Open the terminal, then enter the <code>passwd<\/code> command.<\/p>\n<pre>passwd<\/pre>\n<p>You\u2019ll be prompted to enter your current password, then choose a new one.<\/p>\n<p><strong>RELATED:<\/strong> <strong><em>10 Ways to Generate a Random Password from the Linux Command Line<\/em><\/strong><\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"Discover_the_IP_Address_or_Hostname_for_Your_Raspberry_Pi\"><\/span>Discover the IP Address or Hostname for Your Raspberry Pi<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>You\u2019ll also need to know the hostname or IP address of your Pi. From the terminal, type:<\/p>\n<pre>hostname -i<\/pre>\n<p>This will provide the IP addresses for your Raspberry Pi. There could very well be several listed if you are connected both through Wi-Fi and Ethernet. Most of the time, the address you want will begin with <code>192.168<\/code>. Make note of the address or hostname for later.<\/p>\n<p>With that out of the way, we can turn on SSH.<\/p>\n<p><strong>RELATED:<\/strong> <strong><em>How to Setup Wi-Fi On Your Raspberry Pi via the Command Line<\/em><\/strong><\/p>\n<h2 id=\"Enabling SSH Through the GUI\"><span class=\"ez-toc-section\" id=\"Option_1_Enable_SSH_Through_the_Desktop\"><\/span>Option 1: Enable SSH Through the Desktop<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>One way to turn on SSH is through the Raspberry Pi graphical configuration <a href=\"https:\/\/buradabiliyorum.com\/en\/category\/download-scripts-themes-apps\/\" data-internallinksmanager029f6b8e52c=\"9\" title=\"Download Scripts &amp; Themes &amp; Apps\" target=\"_blank\" rel=\"noopener\">app<\/a>. Just click the Raspberry icon in the top left corner of the screen, then click \u201cPreferences.\u201d Click \u201cRaspberry Pi Configuration.\u201d<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-768056 size-full\" src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2021\/11\/raspberry-pi-configuration.jpg?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Enable SSH on the Raspberry Pi desktop\" width=\"635\" height=\"384\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>In this app, click the \u201cInterfaces\u201d tab and look for \u201cSSH.\u201d Click the \u201cEnable\u201d radio button, then click \u201cOK\u201d to\u00a0close the app.<\/p>\n<h2 id=\"Turning On SSH From the Terminal\"><span class=\"ez-toc-section\" id=\"Option_2_Enable_SSH_From_the_Terminal\"><\/span>Option 2: Enable SSH From the Terminal<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Another method to enable SSH is from the terminal itself, command-line style. Type this command to enter the text-based configuration tool for your Raspberry Pi:<\/p>\n<pre>sudo raspi-config<\/pre>\n<p>Use the arrow keys on your keyboard to select \u201cInterfacing Options,\u201d then press the Enter key.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-768057 size-full\" src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2021\/11\/raspi-config-screen1.jpg?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Select &quot;Interface Options&quot; in SSH configuration\" width=\"564\" height=\"316\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Select \u201cP2 SSH\u201d and press Enter.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-768058 size-full\" src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2021\/11\/raspi-config-screen2.jpg?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Select P2 SSH in the SSH configuration\" width=\"560\" height=\"335\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>When asked, \u201cWould you like the SSH server enabled,\u201d choose \u201cYes.\u201d Press Enter again at the confirmation box, \u201cThe SSH server is enabled. Navigate down and select \u201cFinish.\u201d<\/p>\n<h2 id=\"Before You Go...\"><span class=\"ez-toc-section\" id=\"Disable_SSH_Root_Login\"><\/span>Disable SSH Root Login<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Once you\u2019ve enabled SSH, there is another optional but highly recommended task. Leaving your root user able to SSH into your Raspberry Pi is a security risk, so we recommend disabling root login through SSH. Remember, you can always issue administrative commands from your regular user with sudo.<\/p>\n<p>In your Terminal window, enter this command:<\/p>\n<pre>nano \/etc\/ssh\/sshd_config<\/pre>\n<p>Now, find this line:<\/p>\n<pre>#PermitRootLogin prohibit-password<\/pre>\n<blockquote class=\"admonishment_note\"><p><strong>Note:<\/strong> The line in the configuration file could also read\u00a0<code>#PermitRootLogin yes<\/code>.<\/p><\/blockquote>\n<p>Edit the line to read as follows:<\/p>\n<pre>PermitRootLogin no<\/pre>\n<p>Save and close the file by pressing Ctrl+X, then <code>Y<\/code> . Now, you should reboot the SSH server with this command:<\/p>\n<pre>\/etc\/init.d\/sshd restart<\/pre>\n<p>There are other steps you can take to secure your SSH server even further, so be sure to consider how at-risk your Raspberry Pi can stand to be.<\/p>\n<h2 id=\"Enjoy the Ability to Log Into Your Raspberry Pi from Other Computers\"><span class=\"ez-toc-section\" id=\"Log_Into_Your_Raspberry_Pi_From_Another_Computer\"><\/span>Log Into Your Raspberry Pi From Another Computer<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Once those steps are complete, you\u2019re ready to log into your Raspberry Pi from any computer on your local network. With the IP address or hostname you noted earlier, you can <code>ssh<\/code> into your Pi. That\u2019s done using this command from your other computer:<\/p>\n<pre>ssh pi@[address]<\/pre>\n<p>If your Raspberry Pi\u2019s address is <code>192.168.0.200<\/code> , for example, it will look like this:<\/p>\n<pre>ssh pi@192.168.0.200<\/pre>\n<p>The first time you <code>ssh<\/code> into your Pi, you\u2019ll be asked to accept the encryption key. Just press <code>Y<\/code> , and you\u2019ll connect and be prompted to enter your password. That done, you\u2019ll be logged into the Raspberry Pi and can do whatever tasks you need.<\/p>\n<p>In addition to issuing commands, you can also use SSH for other purposes, such as to tunnel your traffic, transfer files, mount remote file systems, and more. If you\u2019re concerned about security with your Pi, consider setting up two-factor authentication.<\/p>\n<p><strong>RELATED:<\/strong> <strong><em>How to Set Up Two-Factor Authentication on a Raspberry Pi<\/em><\/strong><\/p>\n<\/div>\n<p><script>\n setTimeout(function(){\n  !function(f,b,e,v,n,t,s)\n  {if(f.fbq)return;n=f.fbq=function(){n.callMethod?\n  n.callMethod.apply(n,arguments):n.queue.push(arguments)};\n  if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';\n  n.queue=[];t=b.createElement(e);t.async=!0;\n  t.src=v;s=b.getElementsByTagName(e)[0];\n  s.parentNode.insertBefore(t,s) } (window, document,'script',\n  'https:\/\/connect.facebook.net\/en_US\/fbevents.js');\n   fbq('init', '335401813750447');\n   fbq('track', 'PageView');\n  },3000);\n<\/script><\/p>\n<blockquote><p><strong><span style=\"color: #ff6600;\">If you liked the article, do not forget to share it with your friends. Follow us on\u00a0<span style=\"color: #ff0000;\"><a style=\"color: #ff0000;\" href=\"https:\/\/news.google.com\/publications\/CAAqBwgKMLG0nwswvr63Aw\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Google News<\/a><\/span>\u00a0too, click on the star and choose us from your favorites.<\/span><\/strong><\/p><\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\">For forums sites go to <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/forum.buradabiliyorum.com\/\" target=\"_blank\" rel=\"noopener\">Forum.BuradaBiliyorum.Com<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\"><strong>If you want to read more like this article, you can visit our <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/en.buradabiliyorum.com\/technology\/\" target=\"_blank\" rel=\"noopener\">Technology category.<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<p><span style=\"color: black;\"><a style=\"color: #ff9900;\" href=\"https:\/\/www.howtogeek.com\/768053\/how-to-ssh-into-your-raspberry-pi\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;#How to SSH Into Your Raspberry Pi&#8221; MAB32\/Shutterstock.com After\u00a0setting up your Raspberry Pi, you may not need a display for it. When it comes time for maintenance tasks, like upgrades and reboots, you can use Secure Shell (SSH) instead of plugging in a monitor. We\u2019ll show you how. What Is SSH? SSH, often typed all&#8230;<\/p>\n","protected":false},"author":1,"featured_media":370932,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2021\/11\/Raspberry-Pi-SSH-1.jpg?height=200p&trim=2,2,2,2","fifu_image_alt":"","footnotes":""},"categories":[18],"tags":[],"class_list":["post-370931","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/370931","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/comments?post=370931"}],"version-history":[{"count":0,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/370931\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media\/370932"}],"wp:attachment":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media?parent=370931"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/categories?post=370931"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/tags?post=370931"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}