当前位置:网站首页>如何在开发板上使用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服务器成功
完!
边栏推荐
- unsigned right shift
- Day16 set
- Leetcode刷题记录
- How to judge whether a business is attacked by DDoS? What harm will it cause?
- Complex floating point multiplication of vivado IP core floating point
- Multithreaded server programming
- Is it OK to directly compare the size of two numbers in FPGA?
- Understand the great changes of network security in five years
- Webshell管理工具的流量特征
- 六、 网络互联与互联网
猜你喜欢
随机推荐
day10_异常处理&枚举
Self study understanding of [chain forward star]
九、 组网技术
day15_泛型
虹科Automation softPLC | 虹科KPA MoDK运行环境与搭建步骤(2)——MoDK运行环境搭建
waf防护是什么
[interview questions] the latest software test interview questions in 2022 (400) [with answers] continue to update
day03_2_作业
Complex floating point multiplication of vivado IP core floating point
IGMP protocol software development experiment
Verilog中for语句的使用
右值引用和移动构造
Day16 set
RAW高级套接口实验
day14_ Unit test & Date common class & String common class
网络安全学习(二)
NoClassDefFoundError processing
TCP socket communication experiment
day03_ 2_ task
Ultra low cost DDoS attacks are coming. See how WAF protects Jedi