当前位置:网站首页>sftp部署配置
sftp部署配置
2022-07-23 05:47:00 【study_小达人】
sftp:
SFTP(SSH文件传输协议)是一种网络协议, 可通过任何可靠的数据流提供文件传输和操作功能。它通常与SSH-2协议(TCP端口22)一起使用以提供安全的文件传输,
部署配置:
1、创建用户组 sftp
groupadd sftp
2、创建用户 xinxin02
useradd -G sftp -s /sbin/nologin -d /data/sftp/test
3、创建密码
passwd test
4、修改配置文件 sshd_config
vim /etc/ssh/sshd_config
将下面这行注释
#Subsystem sftp /usr/libexec/openssh/sftp-server
然后在末行加入:
Subsystem sftp internal-sftp 使用内部提供的sftp服务
Match Group sftp 配置sftp组的用户
ChrootDirectory /data/sftp/%u 限制用户
X11Forwarding no 远程图形化显示在本地
AllowTcpForwarding no
#ChrootDirectory %h 可以用 %h代表用户家目录 %u代表用户名
ForceCommand internal-sftp
systemctl restart sshd
5、设置目录权限
chown root:sftp /data/sftp/test
chgrp -R sftp /data/sftp/test
chmod -R 755 /data/sftp/test
#设置用户可以上传的目录, 该用户下允许用户上传删除修改文件及文件夹
Match user sftpuser2
ForceCommand internal-sftp
ChrootDirectory /data/wwwroot/user2/ 多用户就重复三行
边栏推荐
- In depth analysis of replication in redis
- Unity3d+gameframework: resource analysis, resource dependency, circular dependency detection
- 学习日记——(路由与交换技术)三层交换机
- [memory understand the difference and function between ram flash and EEPROM memory]
- C #: quick sort. If there is the same number, it will be ignored, and then continue the previous search direction to find the next number that meets the requirements for replacement
- Explanation of websocket protocol
- Analysis of Internet Protocol (II)
- Unity mouse controls camera drag, rotation and zoom (simulation editor camera function)
- SQL server performance analysis, view slow queries
- 如何解决if语句太多
猜你喜欢

Nas里搭建Frpc客户端【超级无脑】

学习日记——(路由与交换技术)OSPF协议

Unity3d+moba+ skill indicator (II)

Explanation of websocket protocol

LSM-tree(Log Structured-Merge Tree)的理解

DHCP 第二次实验

学习日记——(路由与交换技术)DHCP(动态主机配置协议)

Routing and switching technology - static routing

Routing and interface technology -- Summary of direct network

HCIP---BGP ---边界网关协议
随机推荐
Learning diary - (routing and switching technology) single arm routing
OSPF和RIP的路由扩展配置
OSPF综合实验
C language can also write Plants vs. Zombies
以go语言为例类比侦探推理来讲解【性能分析】
读《凤凰架构》- RPC的历史与知识
Openssl自行签证流程概述
Super easy to use packet capturing tool tcpdump
学习日记——(路由与交换技术)ACL访问控制列表
Unity3d: special effect object pool, timeout delete GameObject in the pool, GC weight
Explain the interactive data flow and block data flow of TCP in detail
Analyze redis server
深入解析Redis中的复制
DNS域名解析服务
Learning diary - (routing and switching technology) dynamic routing (RIP protocol) and static routing
[database] basic theory
Post form submission data limit
C: stack stack source code, array stack, chain stack
Htpasswd action
Learning diary - (routing and switching technology) DHCP (Dynamic Host Configuration Protocol)