• 树莓派安装SSH


    1. 安装ssh

     sudo apt-get install openssh-server 

    2. 检查树莓派SSH服务是否开启

     ps -e|grep ssh 

    3. SSH服务开启

     sudo /etc/init.d/ssh start 

    4. 在树莓派终端输入(临时的,重启失效):

    sudo service ssh start
    sudo service ssh status

    如果ssh运行会打印如下类似信息:

    ssh.service - OpenBSD Secure Shell server
       Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
       Active: active (running) since Mon 2019-06-17 17:17:04 CST; 20h ago
      Process: 403 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
     Main PID: 439 (sshd)
       CGroup: /system.slice/ssh.service
               └─439 /usr/sbin/sshd -D
    
    Jun 18 13:37:50 raspberrypi sshd[21733]: Accepted password for pi from 192.168.169.151 port 2805 ssh2
    Jun 18 13:37:50 raspberrypi sshd[21733]: pam_unix(sshd:session): session opened for user pi by (uid=0)
    Jun 18 14:09:45 raspberrypi sshd[30043]: Accepted password for pi from 192.168.169.151 port 10399 ssh2
    Jun 18 14:09:45 raspberrypi sshd[30043]: pam_unix(sshd:session): session opened for user pi by (uid=0)
    Jun 18 14:13:16 raspberrypi sshd[31028]: Accepted password for pi from 192.168.169.203 port 52093 ssh2
    Jun 18 14:13:16 raspberrypi sshd[31028]: pam_unix(sshd:session): session opened for user pi by (uid=0)
    Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.

    5. 树莓派SSH服务开机自动启动

    在终端命令行中启动SSH服务后,如果系统重启或关机后启动,SSH服务默认是关闭的,依然需要手动启动,为了方便可以设置SSH服务开机自动启动,打开 /etc/rc.local 文件,在语句 exit 0 之前加入:

     /etc/init.d/ssh start 

    6.其他方式开启SSH

    1. 通过 sudo raspi-config 通过可视化界面开启SSH.
    2. 在SD开根目录创建SSH文件,开启SSH.
  • 相关阅读:
    自定义Visual Studio调试器中的对象显示方式
    Visual Studio中的主题定制变得更加容易
    宣布Visual Studio Code Installer for Java
    在Visual Studio 2019中开启预览功能
    .NET Core 3.0预览版7中的ASP.NET Core和Blazor更新
    C#连接SQL Anywhere 12 数据库
    数据库导出脚本
    python http请求及多线程应用
    记录 Ext 日历月份选择控件bug解决过程结果
    js浮点数运算封装, 起因财务部分精确计算
  • 原文地址:https://www.cnblogs.com/Java-Script/p/11096042.html
Copyright © 2020-2023  润新知