惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
罗磊的独立博客
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Last Week in AI
Last Week in AI
云风的 BLOG
云风的 BLOG
T
The Blog of Author Tim Ferriss
Y
Y Combinator Blog
A
About on SuperTechFans
WordPress大学
WordPress大学
B
Blog
Martin Fowler
Martin Fowler
Jina AI
Jina AI
I
InfoQ
P
Proofpoint News Feed
小众软件
小众软件
S
SegmentFault 最新的问题
V
V2EX
B
Blog RSS Feed
量子位
大猫的无限游戏
大猫的无限游戏
aimingoo的专栏
aimingoo的专栏
博客园 - 三生石上(FineUI控件)
MongoDB | Blog
MongoDB | Blog
美团技术团队

博客园 - 懒人ABC

Docker 国内镜像源加速列表(转载,真实可用)-https://zhuanlan.zhihu.com/p/1914353637645345944 windows10操作系统下安装facefusion实现视频换脸(windows server不支持哈) 用spark3.5.2+scala2.13.11+JDK17统计文件单词词频 DeepSeek与Elasticsearch结合,可以通过AI模型增强搜索、分析和自动化能力,实现更智能的数据处理(含订单备货和库存预警案例) 配置navicat客户端通过ssl连接windows server 2025的sqlserver2022数据库服务器 在debain下安装思源黑体(Source Han Sans)的注意点 PHP处理建行数币支付的几种情况 windows10下编译php扩展 获取工作表的名称 获取名称管理器里名称应用的所有单元格 spreadsheet 获取名称管理器 十三、Vue中的computed属性 十二、react-reudx之@connect 摆脱redux的繁琐操作 十一、微信小程序-var、let、const用法详解 十、es6之扩展运算符 三个点(...) 九、小程序 Redux详解与在小程序中怎么使用(action和reducers) 八、wepy代码规范 七、Flex 布局 六、页面跳转和路由
sftp配置多个用户权限的问题
懒人ABC · 2019-12-17 · via 博客园 - 懒人ABC

groupadd group1

chmod 0755 /test/
useradd -g group1 -d /test/backend/ -M test_backend
usermod -s /sbin/nologin test_backend
passwd test_backend
xxxxxxxx

useradd -g group1 -d /test/api/ -M test_api
usermod -s /sbin/nologin test_api
passwd test_api
xxxxxx

useradd -g group1 -d /test/business/ -M test_business
usermod -s /sbin/nologin test_business
passwd test_business
xxxxxx

UseDNS no
AddressFamily inet
SyslogFacility AUTHPRIV
PermitRootLogin yes
PasswordAuthentication yes

# override default of no subsystems
# Subsystem sftp /usr/libexec/openssh/sftp-server
Subsystem sftp internal-sftp

Match User test_backend
ChrootDirectory /test/backend
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp
Match User test_api
ChrootDirectory /test/api
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp
Match User test_business
ChrootDirectory /test/business
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp

systemctl restart sshd

这里有几点

1、主目录的所有者必须为root

即 chown root:root /test

2、权限为chmod 755 /test

3、要想让sftp修改子目录,只能创建子目录来设置权限

mkdir /test/api/project01

chown test_api:group1 /test/api/project01

chmod 755 /test/api/project01