Loading... <p> </p><div style="box-sizing: border-box; color: rgb(64, 64, 64); font-family: -apple-system,BlinkMacSystemFont,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;,&quot;Segoe UI&quot;,&quot;PingFang SC&quot;,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei&quot;,&quot;Helvetica Neue&quot;,Helvetica,Arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"><div style="box-sizing: border-box;"><h1 style="box-sizing: border-box; color: rgb(64, 64, 64); font-weight: 600; margin-bottom: 0.5em; margin-top: 0px;"><b style="box-sizing: border-box; font-weight: 600;">问题:为什么</b><b style="box-sizing: border-box; font-weight: 600;">我的树莓派无法使用远程连接电脑</b><b style="box-sizing: border-box; font-weight: 600;">?</b></h1><h1 style="box-sizing: border-box; color: rgb(64, 64, 64); font-weight: 600; margin-bottom: 0.5em; margin-top: 0px;"><b style="box-sizing: border-box; font-weight: 600;">解答:</b></h1><p style="box-sizing: border-box; margin-bottom: 1em; margin-top: 0px;">由于树莓派只有一个串口,当我们开发中需要占用这个串口或者我们希望进行远程开发(通过一个根网线或无线连接到树莓派)。SSH连接,首先需要确认的是:</p><p style="box-sizing: border-box; margin-bottom: 1em; margin-top: 0px;">1.你的树莓派有没有连接到网络;(不确定请百度:树莓派Raspberry Pi 设置无线上网)</p><p style="box-sizing: border-box; margin-bottom: 1em; margin-top: 0px;">2.使用软件时,填写的ip、用户名和密码是否正确;(不确定请百度:获取树莓派ip地址方法)</p><p style="box-sizing: border-box; margin-bottom: 1em; margin-top: 0px;">3.有没有开启SSH。</p><p style="box-sizing: border-box; margin-bottom: 1em; margin-top: 0px;">科普一下,自己烧录官方系统的小伙伴们注意了,官网的系统默认是不开启SSH的英文版本,而我们售出的SD卡都是开启了SSH的中文版本。本教程针对不懂如何开启SSH的学习者。当然SSH客户端很多,比如:putty、xshell、手机端的juiceSSH等,这里以PuTTY为例:</p><h1 style="box-sizing: border-box; color: rgb(64, 64, 64); font-weight: 600; margin-bottom: 0.5em; margin-top: 0px;"><b style="box-sizing: border-box; font-weight: 600;">详细方法:</b><b style="box-sizing: border-box; font-weight: 600;"><br style="box-sizing: border-box;" /></b></h1><h4 style="box-sizing: border-box; color: rgb(64, 64, 64); font-weight: 600; margin-bottom: 0.5em; margin-top: 0px;"><b style="box-sizing: border-box; font-weight: 600;">方法一:</b></h4><p style="box-sizing: border-box; margin-bottom: 1em; margin-top: 0px;">在命令行输入:sudo /etc/init.d/ssh start,然后回车,如下图1.1:</p><div class="image-package" style="box-sizing: border-box;"><div class="image-container" style="background-color: transparent; box-sizing: border-box; max-height: 48px; max-width: 627px;"><div class="image-container-fill" style="box-sizing: border-box; padding-bottom: 7.66%;"> </div><div class="image-view" data-width="627" data-height="48" style="box-sizing: border-box;"><img data-image-index="0" data-original-src="//upload-images.jianshu.io/upload_images/1578283-eef838a80315c2d3.png" data-original-width="627" data-original-height="48" data-original-format="image/png" data-original-filesize="6154" style="border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; box-sizing: border-box; cursor: zoom-in; vertical-align: middle;" src="http://www.zhaoweifeng.cn/blog/upload/202006012344488788.png?imageMogr2/auto-orient/strip|imageView2/2/w/627" alt="" /></div></div><div class="image-caption" style="box-sizing: border-box;">图1.1</div></div><p style="box-sizing: border-box; margin-bottom: 1em; margin-top: 0px;">注:方法一是临时的(重启后需要重新开启),后面的所有方法都是永久开启</p><h4 style="box-sizing: border-box; color: rgb(64, 64, 64); font-weight: 600; margin-bottom: 0.5em; margin-top: 0px;"><b style="box-sizing: border-box; font-weight: 600;">方法二:</b></h4><p style="box-sizing: border-box; margin-bottom: 1em; margin-top: 0px;">将SD卡连接到电脑上并打开,直接新建“SSH”文件(无后缀)即可,如下图2.1:</p><div class="image-package" style="box-sizing: border-box;"><div class="image-container" style="background-color: transparent; box-sizing: border-box; max-height: 286px; max-width: 359px;"><div class="image-container-fill" style="box-sizing: border-box; padding-bottom: 79.67%;"> </div><div class="image-view" data-width="359" data-height="286" style="box-sizing: border-box;"><img data-image-index="1" data-original-src="//upload-images.jianshu.io/upload_images/1578283-e788ec493b877ea9.png" data-original-width="359" data-original-height="286" data-original-format="image/png" data-original-filesize="58855" style="border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; box-sizing: border-box; cursor: zoom-in; vertical-align: middle;" src="http://www.zhaoweifeng.cn/blog/upload/202006012344508652.png?imageMogr2/auto-orient/strip|imageView2/2/w/359" alt="" /></div></div><div class="image-caption" style="box-sizing: border-box;">图2.1</div></div><h4 style="box-sizing: border-box; color: rgb(64, 64, 64); font-weight: 600; margin-bottom: 0.5em; margin-top: 0px;"><b style="box-sizing: border-box; font-weight: 600;">方法三:</b></h4><p style="box-sizing: border-box; margin-bottom: 1em; margin-top: 0px;">1.如下图3.1,依次打开 菜单(Menu) > 首选项(Preferences) > Raspberry Pi Configuration:</p><div class="image-package" style="box-sizing: border-box;"><div class="image-container" style="background-color: transparent; box-sizing: border-box; max-height: 290px; max-width: 525px;"><div class="image-container-fill" style="box-sizing: border-box; padding-bottom: 55.24%;"> </div><div class="image-view" data-width="525" data-height="290" style="box-sizing: border-box;"><img data-image-index="2" data-original-src="//upload-images.jianshu.io/upload_images/1578283-59e533c927fecd6c.png" data-original-width="525" data-original-height="290" data-original-format="image/png" data-original-filesize="207072" style="border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; box-sizing: border-box; cursor: zoom-in; vertical-align: middle;" src="http://www.zhaoweifeng.cn/blog/upload/202006012344500448.png?imageMogr2/auto-orient/strip|imageView2/2/w/525" alt="" /></div></div><div class="image-caption" style="box-sizing: border-box;">图3.1</div></div><p style="box-sizing: border-box; margin-bottom: 1em; margin-top: 0px;">2.点击 Interfaces 栏,选择“enable” SSH服务。如下图3.2:</p><div class="image-package" style="box-sizing: border-box;"><div class="image-container" style="background-color: transparent; box-sizing: border-box; max-height: 411px; max-width: 482px;"><div class="image-container-fill" style="box-sizing: border-box; padding-bottom: 85.27%;"> </div><div class="image-view" data-width="482" data-height="411" style="box-sizing: border-box;"><img data-image-index="3" data-original-src="//upload-images.jianshu.io/upload_images/1578283-49791cec2154b1bf.png" data-original-width="482" data-original-height="411" data-original-format="image/png" data-original-filesize="42734" style="border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; box-sizing: border-box; cursor: zoom-in; vertical-align: middle;" src="http://www.zhaoweifeng.cn/blog/upload/202006012344503687.png?imageMogr2/auto-orient/strip|imageView2/2/w/482" alt="" /></div></div><div class="image-caption" style="box-sizing: border-box;">图3.2</div></div><h4 style="box- sizing: border-box; color: rgb(64, 64, 64); font-weight: 600; margin-bottom: 0.5em; margin-top: 0px;"><b style="box-sizing: border-box; font-weight: 600;">方法四:</b><b style="box-sizing: border-box; font-weight: 600;"><br style="box-sizing: border-box;" /></b></h4><p style="box-sizing: border-box; margin-bottom: 1em; margin-top: 0px;">1.在命令行输入:sudo raspi-config,然后回车,如下图4.1:</p><div class="image-package" style="box-sizing: border-box;"><div class="image-container" style="background-color: transparent; box-sizing: border-box; max-height: 27px; max-width: 554px;"><div class="image-container-fill" style="box-sizing: border-box; padding-bottom: 4.87%;"> </div><div class="image-view" data-width="554" data-height="27" style="box-sizing: border-box;"><img data-image-index="4" data-original-src="//upload-images.jianshu.io/upload_images/1578283-0de41589bf3a4b1c.png" data-original-width="554" data-original-height="27" data-original-format="image/png" data-original-filesize="5320" style="border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; box-sizing: border-box; cursor: zoom-in; vertical-align: middle;" src="http://www.zhaoweifeng.cn/blog/upload/202006012344510607.png?imageMogr2/auto-orient/strip|imageView2/2/w/554" alt="" /></div></div><div class="image-caption" style="box-sizing: border-box;">图4.1</div></div><p style="box-sizing: border-box; margin-bottom: 1em; margin-top: 0px;">2.选择第七项:“5 Interfacing Options”,回车,如下图4.2:</p><div class="image-package" style="box-sizing: border-box;"><div class="image-container" style="background-color: transparent; box-sizing: border-box; max-height: 258px; max-width: 554px;"><div class="image-container-fill" style="box-sizing: border-box; padding-bottom: 46.57%;"> </div><div class="image-view" data-width="554" data-height="258" style="box-sizing: border-box;"><img data-image-index="5" data-original-src="//upload-images.jianshu.io/upload_images/1578283-952228c56b8733b3.png" data-original-width="554" data-original-height="258" data-original-format="image/png" data-original-filesize="75047" style="border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; box-sizing: border-box; cursor: zoom-in; vertical-align: middle;" src="http://www.zhaoweifeng.cn/blog/upload/202006012344517345.png?imageMogr2/auto-orient/strip|imageView2/2/w/554" alt="" /></div></div><div class="image-caption" style="box-sizing: border-box;">图4.2</div></div><p style="box-sizing: border-box; margin-bottom: 1em; margin-top: 0px;">3.选择第二项:“SSH”,回车,如下图4.3:</p><div class="image-package" style="box-sizing: border-box;"><div class="image-container" style="background-color: transparent; box-sizing: border-box; max-height: 253px; max-width: 554px;"><div class="image-container-fill" style="box-sizing: border-box; padding-bottom: 45.67%;"> </div><div class="image-view" data-width="554" data-height="253" style="box-sizing: border-box;"><img data-image-index="6" data-original-src="//upload-images.jianshu.io/upload_images/1578283-bfe28f358cdbd78b.png" data-original-width="554" data-original-height="253" data-original-format="image/png" data-original-filesize="60863" style="border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; box-sizing: border-box; cursor: zoom-in; vertical-align: middle;" src="http://www.zhaoweifeng.cn/blog/upload/202006012344510614.png?imageMogr2/auto-orient/strip|imageView2/2/w/554" alt="" /></div></div><div class="image-caption" style="box-sizing: border-box;">图4.3</div></div><p style="box-sizing: border-box; margin-bottom: 1em; margin-top: 0px;">4.选择是,回车。如下图4.4:</p><div class="image-package" style="box-sizing: border-box;"><div class="image-container" style="background-color: transparent; box-sizing: border-box; max-height: 318px; max-width: 429px;"><div class="image-container-fill" style="box-sizing: border-box; padding-bottom: 74.13%;"> </div><div class="image-view" data-width="429" data-height="318" style="box-sizing: border-box;"><img data-image-index="7" data-original-src="//upload-images.jianshu.io/upload_images/1578283-b7b01ca4667b967d.png" data-original-width="429" data-original-height="318" data-original-format="image/png" data-original-filesize="6834" style="border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; box-sizing: border-box; cursor: zoom-in; vertical-align: middle;" src="http://www.zhaoweifeng.cn/blog/upload/202006012344515466.png?imageMogr2/auto-orient/strip|imageView2/2/w/429" alt="" /></div></div><div class="image-caption" style="box-sizing: border-box;">图4.4</div></div><p style="box-sizing: border-box; margin-bottom: 1em; margin-top: 0px;">5.最后点选“Finish”完成,等待重启即可,如下图4.5:</p><div class="image-package" style="box-sizing: border-box;"><div class="image-container" style="background-color: transparent; box-sizing: border-box; max-height: 254px; max-width: 554px;"><div class="image-container-fill" style="box-sizing: border-box; padding-bottom: 45.85%;"> </div><div class="image-view" data-width="554" data-height="254" style="box-sizing: border-box;"><img data-image-index="8" data-original-src="//upload-images.jianshu.io/upload_images/1578283-ab5431362a169d0c.png" data-original-width="554" data-original-height="254" data-original-format="image/png" data-original-filesize="71184" style="border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; box-sizing: border-box; cursor: zoom-in; vertical-align: middle;" src="http://www.zhaoweifeng.cn/blog/upload/202006012344510055.png?imageMogr2/auto-orient/strip|imageView2/2/w/554" alt="" /></div></div><div class="image-caption" style="box-sizing: border-box;">图4.5</div></div><p style="box-sizing: border-box; margin-bottom: 1em; margin-top: 0px;"> </p><h1 style="box-sizing: border-box; color: rgb(64, 64, 64); font-weight: 600; margin-bottom: 0.5em; margin-top: 0px;">远程连接树莓派</h1><p style="box-sizing: border-box; margin-bottom: 1em; margin-top: 0px;">SSH客户端推荐PuTTY和Xshell(以PuTTY为例)。</p><p style="box-sizing: border-box; margin-bottom: 1em; margin-top: 0px;">打开PuTTY工具,输入IP,端口默认为22,如图,确定无误后点击 open。</p><div class="image-package" style="box-sizing: border-box;"><div class="image-container" style="background-color: transparent; box-sizing: border-box; max-height: 436px; max-width: 450px;"><div class="image-container-fill" style="box-sizing: border-box; padding-bottom: 96.89%;"> </div><div class="image-view" data-width="450" data-height="436" style="box-sizing: border-box;"><img data-image-index="9" data-original-src="//upload-images.jianshu.io/upload_images/1578283-f2e57613904ac250.png" data-original-width="450" data-original-height="436" data-original-format="image/png" data-original-filesize="50632" style="border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; box-sizing: border-box; cursor: zoom-in; vertical-align: middle;" src="http://www.zhaoweifeng.cn/blog/upload/202006012344515416.png?imageMogr2/auto-orient/strip|imageView2/2/w/450" alt="" /></div></div><div class="image-caption" style="box-sizing: border-box;">以PuTTY为例</div></div><div class="image-package" style="box-sizing: border-box;"><div class="image-container" style="background-color: transparent; box-sizing: border-box; max-height: 344px; max-width: 443px;"><div class="image-container-fill" style="box-sizing: border-box; padding-bottom: 77.65%;"> </div><div class="image-view" data-width="443" data-height="344" style="box-sizing: border-box;"><img data-image-index="10" data-original-src="//upload-images.jianshu.io/upload_images/1578283-f3c1ee1b8dcd4522.png" data-original-width="443" data-original-height="344" data-original-format="image/png" data-original-filesize="31955" style="border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; box-sizing: border-box; cursor: zoom-in; vertical-align: middle;" src="http://www.zhaoweifeng.cn/blog/upload/202006012344516213.png?imageMogr2/auto-orient/strip|imageView2/2/w/443" alt="" /></div></div><div class="image-caption" style="box-sizing: border-box;">默认用户名:pi 默认密码:raspberry</div></div></div><br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" />作者:Vip小木子<br style="box-sizing: border-box;" />链接:https://www.jianshu.com/p/654ee08d2b3a<br style="box-sizing: border-box;" />来源:简书<br style="box-sizing: border-box;" />著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。</div> 最后修改:2020 年 11 月 28 日 03 : 08 AM © 允许规范转载 赞赏 如果觉得我的文章对你有用,请随意赞赏 ×Close 赞赏作者 扫一扫支付 支付宝支付 微信支付