当前位置:网站首页>如何在开发板上使用sftp命令访问sftp-server
如何在开发板上使用sftp命令访问sftp-server
2022-07-29 05:26:00 【BUG键盘侠】
一、背景
1、指定用户只能通过sftp访问上传下载文件,不能通过SSH登陆,并锁定在特定的目录下,而开发板没有sftp,如下图1。
图1

二、需要下载的库件(openssl,openssh)
2.1、下载路径(github官网下载)
2.2、以下为本人下载的库文件分享
https://share.weiyun.com/UOPUjHgo三、Ubuntu交叉编译
3.1、新建安装目录
mkdir test_sftp
cd test_sftp
mkdir source package
mkdir package/openssl
cd source
3.2、把下载的安装包放在此路径下解压
tar -zxvf openssl-3.0.0.tar.gz
tar -zxvf openssh-8.4p1.tar.gz
3.3、openssl编译
cd openssl-3.0.0
./Configure --prefix=/home/gec/Downloads/test_tsftp/package/openssl (--prefix指定安装路径)
source /opt/fsl-framebuffer/2.4.4/environment-setup-cortexa9hf-neon-fsl-linux-gnueabi (声明交叉编译器),我的开发板指定交叉编译器为arm-fsl-linux-gnueabi-gcc。安装路径是/opt/fsl-framebuffer/2.4.4/environment-setup-cortexa9hf-neon-fsl-linux-gnueabi
make
make install
3.4、make后编译可能出现的错误,交叉编译器路径错误,-m64错误(如图2),图3为修改后的Makefile
图2

图3

安装成功后package/openssl/目录下有相关库文件生成
3.4、openssh交叉编译
cd /openssh-8.4p1
./configure --host=arm-fsl-linux-gnueabi --with-ssl-dir=/home/gec/Downloads/test_stftp/package/openssl --disable-etc-default-login
(--host指定交叉编译器,--with-ssl-dir=指向openssl相关库)
make
make成功后可以查找sftp,sftp-server移植到开发板/bin目录下,libcrypto.so.3放在/lib目录下,权限设置为777,
在开发板终端输入sftp,如下图为移植成功

若连接sftp服务器报下图错误,把ssh下载到/usr/local/bin/目录下,权限设置777.

再次登录sftp服务器成功

完!
边栏推荐
- Complex floating point multiplication of vivado IP core floating point
- day12_ Multithreading
- 虹科为您分享EtherCAT demo,教您如何从其他协议快速过渡到EtherCAT工业总线
- Scanbasepackages scanning range configuration
- 2022 summer second day information competition learning achievement sharing 1
- day09_static&final&代码块&抽象类&接口&内部类
- FIR filter design (2) -- vivado calls IP core to design FIR filter
- 六、 网络互联与互联网
- Sequence list and linked list
- 4、 LAN and man
猜你喜欢

使用STP生成树协议解决网络中的二层环路问题

虹科Automation softPLC | MoDK运行环境与搭建步骤(1)——运行环境简介

Joint use skills of joiner.on and stream().Map

EtherCAT主站掉线后,如何保证目标系统免受故障影响?
![[leetcode skimming] array 2 - binary search](/img/50/c006cbe5a91774c99eb782d9203fa0.png)
[leetcode skimming] array 2 - binary search

Thinking about MySQL taking shell through OS shell

day14_ Unit test & Date common class & String common class

自动化测试的生命周期是什么?

MerkleTree 构建QT实现UI

Merkletree builds QT implementation UI
随机推荐
Those vulnerability attacks on app
8、 Network security
解决分频模块modelsim下仿真输出为stx的错误
虹科Automation softPLC | 虹科KPA MoDK运行环境与搭建步骤(2)——MoDK运行环境搭建
6898 changing matrix problem solution
day06_ Classes and objects
FPGA—奇偶数分频和小数分频代码例程
七、 下一代互联网IPV6
day14_单元测试&日期常用类&字符串常用类
Explain the difference between FIR filter and IIR filter in detail
Vivado IP核之定点数转为浮点数Floating-point
FPGA - odd even frequency division and decimal frequency division code routine
三、广域通信网
day10_ Exception handling & enumeration
虹科Automation softPLC | 虹科KPA MoDK运行环境与搭建步骤(3)——MoDK例程测试
day15_泛型
TCP套接口通信实验
day04_ array
3、 Wide area communication network
如何判断业务被DDoS攻击?又会造成哪些危害?