当前位置: 首页 > news >正文

【全志V821_FoxPi】4-1嵌入式系统使能openssh @root

【全志V821_FoxPi】4-1嵌入式系统使能openssh @root

  • 一、背景
  • 二、系统使能openssh
  • 三、系统配置自定义
    • 3-1 /etc/init.d/S60sshd
    • 3-2 /etc/ssh/sshd_config
    • 3-3 /etc/group
    • 3-4 /etc/passwd (sshd)
    • 3-5 /etc/inittab (可选)
    • 3-6 /etc/passwd (root)
    • 3-7 /etc/wifi/wifimg.config
  • 四、编译打包烧录测试

一、背景

在全志V821的板子,通过串口连接来调试或者adb调试的方法是挺好的,但是如果想通过远程进行debug,以及方便文件传输,感觉还是通过网络来调试会快乐一些,而且全志V821是自带wifi的,可以充分利用这一优势。
下面将分享如何适配全志V821的openssh功能。

注:当前使用的是全志V821 Tina SDK V1.2

二、系统使能openssh

在source 和lunch之后,我们通过 make menuconfig 进行使能openssh
直接搜索 openssh
在这里插入图片描述
找到PACKAGE_openssh相关的软件包
在这里插入图片描述
使能以下三个:
注:openssh-server 使用带 pam 版本

  • openssh-keygen
  • openssh-server-pam
  • openssh-sftp-server
    在这里插入图片描述

三、系统配置自定义

以下配置均在SDK的方案目标板子的target的busybox-init-base-files中修改,我的路径在:
(仅供参考)
/opt/Tina_V821_V1.2/openwrt/target/v821/v821-foxpi_ipc/busybox-init-base-files#

3-1 /etc/init.d/S60sshd

目的:对默认的启动脚本稍作修改,以实现openssj自启动
操作:在 /etc/init.d 新建 S60sshd 文件,写入以下内容:

#!/bin/sh /etc/rc.common
# Copyright (C) 2006-2011 OpenWrt.orgSTART=50
STOP=50USE_PROCD=1
PROG=/usr/sbin/sshdstart_service() {for type in rsa ed25519do# check for keyskey=/etc/ssh/ssh_host_${type}_key[ ! -f $key ] && {# generate missing keys[ -x /usr/bin/ssh-keygen ] && {/usr/bin/ssh-keygen -N '' -t $type -f $key 2>&- >&-}}donemkdir -m 0700 -p /var/emptylocal lport=$(awk '/^Port / { print $2; exit }' /etc/ssh/sshd_config)[ -z "$lport" ] && lport=22procd_open_instance#procd_add_mdns "ssh" "tcp" "$lport"procd_set_param command $PROG -Dprocd_close_instance
}shutdown() {local pidstop# kill active clientsfor pid in $(pidof sshd)do[ "$pid" = "$$" ] && continue[ -e "/proc/$pid/stat" ] && kill $piddone
}

3-2 /etc/ssh/sshd_config

目的:对默认的启动参数稍作修改,以实现openssj自启动(允许root登录等)
操作:在 /etc/ssh新建 sshd_config 文件,写入以下内容:

#       $OpenBSD: sshd_config,v 1.103 2018/04/09 20:41:22 tj Exp $# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented.  Uncommented options override the
# default value.Port 22
AddressFamily any
ListenAddress 0.0.0.0
#ListenAddress ::HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key# Ciphers and keying
#RekeyLimit default none# Logging
#SyslogFacility AUTH
#LogLevel INFO# Authentication:#LoginGraceTime 2m
PermitRootLogin ye
http://www.dtcms.com/a/447139.html

相关文章:

  • itc 做市场分析的网站厦门seo推广优化
  • 做网站方案北京网站建设方案排名
  • 【LangChain】P13 LangChain 提示词模板深度解析(四):MessagePlaceholder 与少量样本示例详解
  • 点击app图标进入网站怎么做无锡优化
  • flutter专栏--深入了解widget原理
  • Java面试 -- 数据结构
  • 网站在政务新媒体建设方案济南seo排名关键词
  • Vite 构建优化实战:从配置到落地的全方位性能提升指南
  • 林州网站建设哪家专业自助建站和网站开发的利弊
  • 例外:已选中、未选中和自定义
  • 织梦网站怎么关闭手机模板合肥关键词排名技巧
  • wordpress付费阅读插件seo具体是什么
  • 上海网站推广营销设计展览馆设计公司排名
  • Effective Python 第39条:通过@classmethod多态来构造同一体系中的各类对象
  • 全flash网站模板wordpress dnax
  • 做网站有的浏览器网站建设元
  • 概率论:分布与检验(持续学习中)
  • 培训网站 建武昌网站建设制作
  • 上海网站建设免网站建设那家做的好
  • 网站的关键字 设置建设部网站首页
  • jetson nano 搭建crow环境
  • 宁波网站建设流程免费签名设计软件
  • 怎样做国外电子商务网站简单房地产网站
  • 浏览器显示不安全网站建设个人网页制作价格
  • .net 做手机网站吗电商seo与sem是什么
  • 企业局域网做网站屏蔽一流的高密做网站的
  • 哪有深圳网站页面设计通用企业手机网站模板
  • 《嵌入式驱动(四):设备树》
  • [人工智能-综述-20]:AI智能体、大模型的关系:大模型是AI智能体的“大脑”,而AI智能体是让大模型“行动起来”的完整生命体。
  • 函数内部数据的有效访问的“加锁”操作